diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/configstore | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/configstore')
-rw-r--r-- | node_modules/configstore/index.js | 8 | ||||
-rw-r--r-- | node_modules/configstore/package.json | 90 |
2 files changed, 53 insertions, 45 deletions
diff --git a/node_modules/configstore/index.js b/node_modules/configstore/index.js index 4883613ca..fb944204b 100644 --- a/node_modules/configstore/index.js +++ b/node_modules/configstore/index.js @@ -24,6 +24,7 @@ class Configstore { this.path = path.join(configDir, pathPrefix); this.all = Object.assign({}, defaults, this.all); } + get all() { try { return JSON.parse(fs.readFileSync(this.path, 'utf8')); @@ -48,6 +49,7 @@ class Configstore { throw err; } } + set all(val) { try { // Make sure the folder exists as it could have been deleted in the meantime @@ -63,12 +65,15 @@ class Configstore { throw err; } } + get size() { return Object.keys(this.all || {}).length; } + get(key) { return dotProp.get(this.all, key); } + set(key, val) { const config = this.all; @@ -82,14 +87,17 @@ class Configstore { this.all = config; } + has(key) { return dotProp.has(this.all, key); } + delete(key) { const config = this.all; dotProp.delete(config, key); this.all = config; } + clear() { this.all = {}; } diff --git a/node_modules/configstore/package.json b/node_modules/configstore/package.json index c39039759..6a862f526 100644 --- a/node_modules/configstore/package.json +++ b/node_modules/configstore/package.json @@ -1,47 +1,47 @@ { - "name": "configstore", - "version": "3.1.1", - "description": "Easily load and save config without having to think about where and how", - "license": "BSD-2-Clause", - "repository": "yeoman/configstore", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "config", - "store", - "storage", - "conf", - "configuration", - "settings", - "preferences", - "json", - "data", - "persist", - "persistent", - "save" - ], - "dependencies": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - } + "name": "configstore", + "version": "3.1.2", + "description": "Easily load and save config without having to think about where and how", + "license": "BSD-2-Clause", + "repository": "yeoman/configstore", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "config", + "store", + "storage", + "conf", + "configuration", + "settings", + "preferences", + "json", + "data", + "persist", + "persistent", + "save" + ], + "dependencies": { + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } } |