{"_id":"gruntfile-editor","_rev":"273988","name":"gruntfile-editor","description":"API to modify the content of a Gruntfile.js file","dist-tags":{"latest":"1.2.1"},"maintainers":[{"name":"sboudrias","email":""}],"time":{"modified":"2021-06-03T17:53:09.000Z","created":"2014-04-07T01:46:58.253Z","1.2.1":"2016-11-20T00:33:47.014Z","1.2.0":"2016-03-29T06:45:59.914Z","1.1.0":"2015-10-22T07:40:38.885Z","1.0.0":"2015-02-18T07:22:25.682Z","0.2.0":"2014-08-08T05:31:00.260Z","0.1.1":"2014-06-23T07:10:44.613Z","0.1.0":"2014-04-07T01:46:58.253Z"},"users":{"itonyyo":true},"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"repository":{"type":"git","url":"git+https://github.com/sboudrias/gruntfile-editor.git"},"versions":{"1.2.1":{"name":"gruntfile-editor","version":"1.2.1","description":"API to modify the content of a Gruntfile.js file","author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"files":["lib"],"main":"lib/index.js","keywords":["gruntfile","ast"],"license":"MIT","scripts":{"test":"gulp","prepublish":"gulp prepublish"},"repository":{"type":"git","url":"git+https://github.com/sboudrias/gruntfile-editor.git"},"dependencies":{"ast-query":"^2.0.0","lodash":"^4.6.1"},"devDependencies":{"mocha":"^3.1.2","eslint":"^3.10.2","eslint-config-xo-space":"^0.15.0","gulp":"^3.9.0","gulp-eslint":"^3.0.1","gulp-exclude-gitignore":"^1.0.0","gulp-line-ending-corrector":"^1.0.1","gulp-istanbul":"^1.1.1","gulp-mocha":"^3.0.1","gulp-plumber":"^1.0.0","gulp-nsp":"^2.1.0","gulp-coveralls":"^0.1.0"},"eslintConfig":{"extends":"xo-space","env":{"mocha":true},"rules":{"eqeqeq":[2,"allow-null"],"no-eq-null":0,"no-mixed-operators":0,"quotes":0}},"gitHead":"85fcb6994f8fcc3775789e4c51c79cadbfe0d00e","bugs":{"url":"https://github.com/sboudrias/gruntfile-editor/issues"},"homepage":"https://github.com/sboudrias/gruntfile-editor#readme","_id":"gruntfile-editor@1.2.1","_shasum":"366fc1f93cbf045813e1448aef1da9f18289d5eb","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"366fc1f93cbf045813e1448aef1da9f18289d5eb","size":3473,"noattachment":false,"key":"/gruntfile-editor/-/gruntfile-editor-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/gruntfile-editor/download/gruntfile-editor-1.2.1.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/gruntfile-editor-1.2.1.tgz_1479602026781_0.26689936709590256"},"directories":{},"publish_time":1479602027014,"_cnpm_publish_time":1479602027014,"_hasShrinkwrap":false},"1.2.0":{"name":"gruntfile-editor","version":"1.2.0","description":"API to modify the content of a Gruntfile.js file","author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"files":["lib"],"main":"lib/index.js","keywords":["gruntfile","ast"],"license":"MIT","scripts":{"test":"gulp","prepublish":"gulp prepublish"},"repository":{"type":"git","url":"git+https://github.com/sboudrias/gruntfile-editor.git"},"dependencies":{"ast-query":"^1.0.1","lodash":"^4.6.1"},"devDependencies":{"mocha":"^2.1.0","eslint":"^2.1.0","eslint-config-xo-space":"^0.10.0","gulp":"^3.9.0","gulp-eslint":"^2.0.0","gulp-exclude-gitignore":"^1.0.0","gulp-line-ending-corrector":"^1.0.1","gulp-istanbul":"^0.10.3","gulp-mocha":"^2.0.0","gulp-plumber":"^1.0.0","gulp-nsp":"^2.1.0","gulp-coveralls":"^0.1.0"},"eslintConfig":{"extends":"xo-space","env":{"mocha":true},"rules":{"eqeqeq":[2,"allow-null"],"no-eq-null":0}},"gitHead":"750c1ecef4f5fc9c234de7e23c100a00c8e3a3b3","bugs":{"url":"https://github.com/sboudrias/gruntfile-editor/issues"},"homepage":"https://github.com/sboudrias/gruntfile-editor#readme","_id":"gruntfile-editor@1.2.0","_shasum":"169cc7ff532f0b2eb900eec351f7a2bf668302d0","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.9.0","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"169cc7ff532f0b2eb900eec351f7a2bf668302d0","size":3466,"noattachment":false,"key":"/gruntfile-editor/-/gruntfile-editor-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gruntfile-editor/download/gruntfile-editor-1.2.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/gruntfile-editor-1.2.0.tgz_1459233959485_0.7322243058588356"},"directories":{},"publish_time":1459233959914,"_cnpm_publish_time":1459233959914,"_hasShrinkwrap":false},"1.1.0":{"name":"gruntfile-editor","version":"1.1.0","description":"API to modify the content of a Gruntfile.js file","author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","keywords":["gruntfile","ast"],"files":["index.js","default-gruntfile.js"],"scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git+https://github.com/sboudrias/gruntfile-editor.git"},"dependencies":{"ast-query":"^1.0.1","lodash":"^3.2.0"},"devDependencies":{"mocha":"^2.1.0"},"gitHead":"292efb4a21b84905ce998aa09f048873f94692e0","bugs":{"url":"https://github.com/sboudrias/gruntfile-editor/issues"},"homepage":"https://github.com/sboudrias/gruntfile-editor#readme","_id":"gruntfile-editor@1.1.0","_shasum":"53d882bbbaca4e9bc526c24268748b64210a4c00","_from":".","_npmVersion":"2.14.2","_nodeVersion":"0.12.7","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"53d882bbbaca4e9bc526c24268748b64210a4c00","size":3047,"noattachment":false,"key":"/gruntfile-editor/-/gruntfile-editor-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gruntfile-editor/download/gruntfile-editor-1.1.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1445499638885,"_cnpm_publish_time":1445499638885,"_hasShrinkwrap":false},"1.0.0":{"name":"gruntfile-editor","version":"1.0.0","description":"API to modify the content of a Gruntfile.js file","author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","keywords":["gruntfile","ast"],"files":["index.js","default-gruntfile.js"],"scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"https://github.com/SBoudrias/gruntfile-editor"},"dependencies":{"ast-query":"^1.0.1","lodash":"^3.2.0"},"devDependencies":{"mocha":"^2.1.0"},"gitHead":"2ef868e9da95adcc5a091fca5e3a20a6ca8ea35a","bugs":{"url":"https://github.com/SBoudrias/gruntfile-editor/issues"},"homepage":"https://github.com/SBoudrias/gruntfile-editor","_id":"gruntfile-editor@1.0.0","_shasum":"347df767c673599419e708fbbb8d03b8da1102c2","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.32","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":""}],"dist":{"shasum":"347df767c673599419e708fbbb8d03b8da1102c2","size":2868,"noattachment":false,"key":"/gruntfile-editor/-/gruntfile-editor-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gruntfile-editor/download/gruntfile-editor-1.0.0.tgz"},"directories":{},"publish_time":1424244145682,"_cnpm_publish_time":1424244145682,"_hasShrinkwrap":false},"0.2.0":{"name":"gruntfile-editor","version":"0.2.0","description":"API to modify the content of a Gruntfile.js file","author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","homepage":"https://github.com/SBoudrias/gruntfile-editor","keywords":["gruntfile","ast"],"main":"index.js","files":["index.js","default-gruntfile.js","LICENSE-MIT"],"scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/SBoudrias/gruntfile-editor.git"},"bugs":{"url":"https://github.com/SBoudrias/gruntfile-editor/issues"},"dependencies":{"ast-query":"~0.2.3","lodash":"~2.4.1"},"_id":"gruntfile-editor@0.2.0","dist":{"shasum":"e1ccb700766b8c461662449a70ad4e7cabb022e2","size":3281,"noattachment":false,"key":"/gruntfile-editor/-/gruntfile-editor-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gruntfile-editor/download/gruntfile-editor-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1407475860260,"_cnpm_publish_time":1407475860260,"_hasShrinkwrap":false},"0.1.1":{"name":"gruntfile-editor","version":"0.1.1","description":"API to modify the content of a Gruntfile.js file","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/SBoudrias/gruntfile-editor.git"},"keywords":["gruntfile","ast"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","bugs":{"url":"https://github.com/SBoudrias/gruntfile-editor/issues"},"homepage":"https://github.com/SBoudrias/gruntfile-editor","dependencies":{"ast-query":"~0.2.3","lodash":"~2.4.1"},"_id":"gruntfile-editor@0.1.1","dist":{"shasum":"b8db939fdc9831fcea46519b99eb507d9a51ed41","size":3819,"noattachment":false,"key":"/gruntfile-editor/-/gruntfile-editor-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/gruntfile-editor/download/gruntfile-editor-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1403507444613,"_cnpm_publish_time":1403507444613,"_hasShrinkwrap":false},"0.1.0":{"name":"gruntfile-editor","version":"0.1.0","description":"API to modify the content of a Gruntfile.js file","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/SBoudrias/gruntfile-editor.git"},"keywords":["gruntfile","ast"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","bugs":{"url":"https://github.com/SBoudrias/gruntfile-editor/issues"},"homepage":"https://github.com/SBoudrias/gruntfile-editor","dependencies":{"ast-query":"~0.2.3","lodash":"~2.4.1"},"_id":"gruntfile-editor@0.1.0","dist":{"shasum":"b6cd84776dbf0681c16c95a8fce1f8ebb1b4e49e","size":3674,"noattachment":false,"key":"/gruntfile-editor/-/gruntfile-editor-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gruntfile-editor/download/gruntfile-editor-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1396835218253,"_cnpm_publish_time":1396835218253,"_hasShrinkwrap":false}},"readme":"Gruntfile Editor\n================\n\n[![npm](https://badge.fury.io/js/gruntfile-editor.svg)](http://badge.fury.io/js/gruntfile-editor) [![tests](https://travis-ci.org/SBoudrias/gruntfile-editor.svg?branch=master)](https://travis-ci.org/SBoudrias/gruntfile-editor) [![Coverage Status](https://coveralls.io/repos/github/SBoudrias/gruntfile-editor/badge.svg?branch=master)](https://coveralls.io/github/SBoudrias/gruntfile-editor?branch=master) [![dependencies](https://david-dm.org/SBoudrias/gruntfile-editor.svg?theme=shields.io)](https://david-dm.org/SBoudrias/gruntfile-editor)\n\nAn API to modify a `Gruntfile.js` content\n\nInstallation\n---------------\n\n```\nnpm install --save gruntfile-editor\n```\n\nExample\n---------------\n\n```javascript\nvar GruntfileEditor = require('gruntfile-editor');\nvar editor = new GruntfileEditor();\n\neditor.insertConfig('compass', '{ foo: \"bar\" }');\n\nfs.writeFileSync('Gruntfile.js', editor.toString());\n```\n\nAPI\n--------------\n\n### `new GruntfileEditor( content )`\n\nCreate a new editor instance. You can pass the content of the Gruntfile to edit to the constructor. If no content is provided, a default file structure is used.\n\n### `editor.insertConfig( name, config )`\n\nInsert a configuration block inside the `grunt.initConfig()` call.\n\n### `editor.registerTask( name, tasks )`\n\nRegister a task inside a named task group\n\n```javascript\neditor.registerTask('build', 'compass');\n// output: grunt.registerTask('build', ['compass']);\n\neditor.registerTask('build', ['compass', 'uglify']);\n// output: grunt.registerTask('build', ['compass', 'uglify']);\n```\n\nYou can specify an optional description.\n\n```javascript\neditor.registerTask('build', 'A task description', ['compass', 'uglify']);\n// output: grunt.registerTask('build', 'A task description', ['compass', 'uglify']);\n```\n\n### `editor.insertVariable( name, value )`\n\nInsert a variable to the top of the Gruntfile.\n\n```javascript\neditor.insertVariable('root', '\"project/foo\"');\n// output: var root = 'project/foo';\n```\n\n### `editor.prependJavaScript( code )`\n\nInsert a piece of arbritary JavaScript code to the top of the Gruntfile.\n\n```javascript\neditor.prependJavaScript('require(\\'load-grunt-tasks\\')(grunt);');\n// output: require('load-grunt-tasks')(grunt);\n```\n\n### `editor.loadNpmTasks( pluginName )`\n\nLoad a Grunt plugin.\n\n```javascript\neditor.loadNpmTasks('grunt-contrib-uglify');\n// output: grunt.loadNpmTasks(\"grunt-contrib-uglify\");\n\neditor.loadNpmTasks(['grunt-contrib-uglify', 'grunt-contrib-concat']);\n// output:\n// grunt.loadNpmTasks(\"grunt-contrib-concat\");\n// grunt.loadNpmTasks(\"grunt-contrib-uglify\");\n```\n\n\n### `editor.toString()`\n\nReturns the modified Gruntfile as a string.\n\nLicence\n-----------\n\nCopyright (c) 2012 Simon Boudrias (twitter: @vaxilart)  \nLicensed under the MIT license.\n","_attachments":{},"homepage":"https://github.com/sboudrias/gruntfile-editor#readme","bugs":{"url":"https://github.com/sboudrias/gruntfile-editor/issues"},"license":"MIT"}