Write your json files easily.
npm install grunt-json-generator~0.4.1
shell
npm install grunt-json-generator --save-dev
`
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-json-generator');
`
The "json_generator" task
$3
In your project's Gruntfile, add a section named json_generator to the data object passed into grunt.initConfig().
`js
grunt.initConfig({
json_generator: {
your_target: {
dest: "", // Destination file
options: {
// Your json file goes here
}
}
}
});
`
$3
There are no options themselves. The options are just your json file, that's all.
$3
`js
json_generator: {
target: {
dest: "bower.json",
options: {
name: "json-generator",
version: "0.1.0",
description: "Generating json files on the fly really easily.",
keywords: ["json", "grunt"]
}
}
}
``