Create a gist now

Instantly share code, notes, and snippets.

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