Skip to content

Commit f35eab1

Browse files
authored
Merge pull request #6 from de-luca/feature/readFile-instead-of-require
Use readFileSync instead of require
2 parents 00c0705 + d285a6b commit f35eab1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "electron-json-config",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Simply set and get configuration from a json file for your Electron app",
55
"main": "src/index.js",
66
"keywords": [

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const file = (electron.app || electron.remote.app).getPath('userData')+'/config.
88
if(!exists.sync(file)) {
99
fs.writeFileSync(file, '{}');
1010
}
11-
var config = require(file);
11+
var config = JSON.parse(fs.readFileSync(file));
1212

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

0 commit comments

Comments
 (0)