Skip to content

Instantly share code, notes, and snippets.

@venkatperi
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venkatperi/a5bb9f00479f8af53a8a to your computer and use it in GitHub Desktop.
Save venkatperi/a5bb9f00479f8af53a8a to your computer and use it in GitHub Desktop.
cson with nconf
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
a :
aa : 11
b : "2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment