Created
June 1, 2018 10:32
-
-
Save maciektr/7f621acc25ba64a104370d9abb49284f to your computer and use it in GitHub Desktop.
nodjes config file example
This file contains 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
{ | |
"category":{ | |
"option" : "value" | |
} | |
} |
This file contains 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
'use strict'; | |
let fs = require('fs'); | |
let configPath = __dirname+'/config.json'; | |
let parsed = JSON.parse(fs.readFileSync(configPath, 'UTF-8')); | |
exports.category = parsed.category; |
This file contains 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 options = require(__dirname + '/options.js'); | |
console.log(options.category.option); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment