electron-json-config
Advanced tools
Comparing version 1.4.0 to 1.5.0
{ | ||
"name": "electron-json-config", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Simply set and get configuration from a json file for your Electron app", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -11,4 +11,6 @@ 'use strict'; | ||
} | ||
var config = JSON.parse(fs.readFileSync(file)); | ||
let config = JSON.parse(fs.readFileSync(file)); | ||
exports.file = function() { | ||
@@ -27,2 +29,9 @@ return file; | ||
exports.setBulk = function(items) { | ||
for (let key in items) { | ||
u.set(config, key)(items[key]); | ||
} | ||
u.sync(file, config); | ||
}; | ||
exports.get = function(key, defaultValue) { | ||
@@ -46,2 +55,9 @@ const value = u.search(config, key); | ||
exports.deleteBulk = function(keys) { | ||
for (let key of keys) { | ||
u.remove(config, key)(); | ||
} | ||
u.sync(file, config); | ||
}; | ||
exports.purge = function() { | ||
@@ -48,0 +64,0 @@ config = {}; |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
98
3290
3
2
0