Grunt task for compiling CSON files to JSON
npm install grunt-csonGrunt plugin to compile CSON files to JSON.
``sh`
npm install grunt-cson
* Run grunt to compile the CoffeeScript code
* Run grunt test to run the specsConfiguring
Add the following to your
Gruntfile.coffee:`coffeescript
grunt.initConfig
cson:
glob_to_multiple:
expand: true
src: ['src/*/.cson' ]
dest: 'lib'
ext: '.json'grunt.loadNpmTasks('grunt-cson')
`Then run
grunt cson to compile all the .cson files under src/ to .json
files under lib/.$3
The following are options are supported when configuring the task.
`coffeescript
cson:
options:
rootObject: true | false
`#### rootObject
Setting this to
true will verify that each file parsed contains a single
root object (such as in package.json). This option defaults to false`.