Created
January 14, 2017 20:12
-
-
Save yannbertrand/c2f6f246df2c35e45a2bba7237688da3 to your computer and use it in GitHub Desktop.
electron-config default usage not working
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Config = require('electron-config'); | |
const config = new Config(); | |
config.set('unicorn', '🦄'); | |
console.log(config.get('unicorn')); | |
//=> '🦄' | |
// use dot-notation to access nested properties | |
config.set('foo.bar', true); | |
console.log(config.get('foo')); | |
//=> {bar: true} | |
config.delete('unicorn'); | |
console.log(config.get('unicorn')); | |
//=> undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "electron-config-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"electron": "^1.4.14", | |
"electron-config": "^0.2.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment