Skip to content

Commit

Permalink
Merge pull request #6 from de-luca/feature/readFile-instead-of-require
Browse files Browse the repository at this point in the history
Use readFileSync instead of require
  • Loading branch information
de-luca committed Jul 12, 2016
2 parents 00c0705 + d285a6b commit f35eab1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-json-config",
"version": "1.1.0",
"version": "1.2.0",
"description": "Simply set and get configuration from a json file for your Electron app",
"main": "src/index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const file = (electron.app || electron.remote.app).getPath('userData')+'/config.
if(!exists.sync(file)) {
fs.writeFileSync(file, '{}');
}
var config = require(file);
var config = JSON.parse(fs.readFileSync(file));

const sync = function() {
fs.writeFileSync(file, JSON.stringify(config));
Expand Down

0 comments on commit f35eab1

Please sign in to comment.