0.0.5 • Published 9 years ago

grunt-json-extend v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

#grunt-json-extend

grunt plugin for generate extended json files.

install

npm install --save-dev grunt-json-extend

example

src

[
    {
        "foo": "bar"
    }
]

dest

[
    {
        "foo": "bar",
        "baz": "foobar"
    }
]

usage

module.exports = function(grunt) {
	grunt.initConfig({
		jsonExtend: {

            // add source json file here.
			src: './json/test-before.json',

            // add destination json file here.
			dest: './json/test-after.json',

            // write callback functions as array,
            // to extend your object's property.
			callbacks: [
				function( obj ){
                    // obj is each object from src.

                    var result = 'foo' + '+' + obj.foo;

                    // return object, you want to add for json file.
					return {
						"baz": result
					};
				}
			]
		}
	});
	grunt.task.loadTasks("tasks");
	grunt.registerTask( 'default', [ 'jsonExtend' ]);
};
0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago