Last active
August 29, 2015 14:07
-
-
Save venkatperi/a5bb9f00479f8af53a8a to your computer and use it in GitHub Desktop.
cson with nconf
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
nconf = require 'nconf' | |
cson = require 'cson' | |
csonFormat = | |
stringify : cson.stringifySync | |
parse : cson.parseSync | |
nconf.file file : "#{__dirname}/test.cson", format : csonFormat | |
console.log nconf.get "a" | |
console.log nconf.get "b" | |
# output: | |
# { aa: 11 } | |
# 2 |
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
a : | |
aa : 11 | |
b : "2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment