{"_id":"grunt-file-creator","_rev":"19-b873421b438a98e99da625279f1ea34c","name":"grunt-file-creator","description":"Creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).","dist-tags":{"latest":"0.1.3"},"versions":{"0.0.1":{"name":"grunt-file-creator","description":"A grunt task that creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).","version":"0.0.1","homepage":"https://github.com/travis-hilterbrand/grunt-file-creator","author":{"name":"Travis Hilterbrand","url":"https://github.com/travis-hilterbrand/grunt-file-creator"},"repository":{"type":"git","url":"git://github.com/travis-hilterbrand/grunt-file-creator.git"},"bugs":{"url":"https://github.com/travis-hilterbrand/grunt-file-creator/issues"},"licenses":[{"type":"MIT","url":"https://github.com/travis-hilterbrand/grunt-file-creator/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":"*"},"scripts":{"test":"./node_modules/.bin/grunt test"},"dependencies":{},"devDependencies":{"grunt":"devel","grunt-contrib-jshint":"~0.1.0","grunt-contrib-nodeunit":"~0.1.0","grunt-cli":"~0.1.2"},"keywords":["gruntplugin"],"contributors":[{"name":"Travis Hilterbrand","url":"http://github.com/travis-hilterbrand"}],"_id":"grunt-file-creator@0.0.1","dist":{"shasum":"950f1b721659d2e6fffc6be717a665d379b7a387","tarball":"https://registry.npmjs.org/grunt-file-creator/-/grunt-file-creator-0.0.1.tgz","integrity":"sha512-To9FeM+NPEDVTAtmaQYaP65G8uY1w52Fxz66ub7ZW6TUbP/LFBAzaEz4khyhztE/cCu97bo2c1bqjA5lxDm2mQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDP5NFGhEv9228b+1VxPsz9Qpe7/P6aBnHn94UXQSdoSwIgK28HtcfuYiqUe8X1gYML/o05CcKKdY8E3D2/X4IEgb8="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"},"maintainers":[{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"}]},"0.0.2":{"name":"grunt-file-creator","description":"Creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).","version":"0.0.2","homepage":"https://github.com/travis-hilterbrand/grunt-file-creator","author":{"name":"Travis Hilterbrand","url":"https://github.com/travis-hilterbrand/grunt-file-creator"},"repository":{"type":"git","url":"git://github.com/travis-hilterbrand/grunt-file-creator.git"},"bugs":{"url":"https://github.com/travis-hilterbrand/grunt-file-creator/issues"},"licenses":[{"type":"MIT","url":"https://github.com/travis-hilterbrand/grunt-file-creator/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":"*"},"scripts":{"test":"./node_modules/.bin/grunt test"},"dependencies":{},"devDependencies":{"grunt":"devel","grunt-contrib-jshint":"~0.1.0","grunt-contrib-nodeunit":"~0.1.0","grunt-cli":"~0.1.2"},"keywords":["gruntplugin"],"contributors":[{"name":"Travis Hilterbrand","url":"http://github.com/travis-hilterbrand"}],"_id":"grunt-file-creator@0.0.2","dist":{"shasum":"8ff9a9dc32dd5e63392a7701254f2df62254b6d8","tarball":"https://registry.npmjs.org/grunt-file-creator/-/grunt-file-creator-0.0.2.tgz","integrity":"sha512-8pBju1dRtcCKF+VbXXiGg/hqBzpyck1vFVxx3tiSrPfMuAIFe1BPOD4ZLu7RDtUIx8neSsdzeHjWUAtzjJpOEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4whQGZ++Ytlio57VljbpDCFSk4EbZFh9hVi4leUu7sQIgd5WI/Ek2yj3UB1efQICAcODNDHdjSoUrEPGMZpilL9M="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"},"maintainers":[{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"}]},"0.1.0":{"name":"grunt-file-creator","description":"Creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).","version":"0.1.0","homepage":"https://github.com/travis-hilterbrand/grunt-file-creator","author":{"name":"Travis Hilterbrand","url":"https://github.com/travis-hilterbrand/grunt-file-creator"},"repository":{"type":"git","url":"git://github.com/travis-hilterbrand/grunt-file-creator.git"},"bugs":{"url":"https://github.com/travis-hilterbrand/grunt-file-creator/issues"},"licenses":[{"type":"MIT","url":"https://github.com/travis-hilterbrand/grunt-file-creator/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":"*"},"scripts":{"test":"./node_modules/.bin/grunt test"},"dependencies":{},"devDependencies":{"grunt":"~0.4","grunt-contrib-jshint":"~0.1.0","grunt-contrib-nodeunit":"~0.1.0"},"keywords":["gruntplugin"],"contributors":[{"name":"Travis Hilterbrand","url":"http://github.com/travis-hilterbrand"}],"_id":"grunt-file-creator@0.1.0","dist":{"shasum":"a85fde3083e41c419c973d05986a9b602dfb5c37","tarball":"https://registry.npmjs.org/grunt-file-creator/-/grunt-file-creator-0.1.0.tgz","integrity":"sha512-EQvjzXjeF7WIaEGEK1gTcMJH2fXUknGtQgvocAUCb4wzxlPyTIe5lrLR2UGDARdWn+csi5R0SwpI6kS252Dxdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD49zLqLXI9mhg/tx6+Xhf0ro4PYQLbSlw3fWF4dTKNogIhAPHu4pJRsUUgF4u/c5ysleOW8rtV/M4oZuSaO+9c7eAe"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thilterbrand","email":"travis_hilterbrand@yahoo.com"},"maintainers":[{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"}]},"0.1.1":{"name":"grunt-file-creator","description":"Creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).","version":"0.1.1","homepage":"https://github.com/travis-hilterbrand/grunt-file-creator","author":{"name":"Travis Hilterbrand","url":"https://github.com/travis-hilterbrand/grunt-file-creator"},"repository":{"type":"git","url":"git://github.com/travis-hilterbrand/grunt-file-creator.git"},"bugs":{"url":"https://github.com/travis-hilterbrand/grunt-file-creator/issues"},"licenses":[{"type":"MIT","url":"https://github.com/travis-hilterbrand/grunt-file-creator/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":"*"},"scripts":{"test":"./node_modules/.bin/grunt test"},"dependencies":{},"devDependencies":{"grunt":"~0.4","grunt-contrib-clean":"~0.5.0","grunt-contrib-jshint":"~0.1.0","grunt-contrib-nodeunit":"~0.1.0","node-fs":"~0.1.7"},"keywords":["gruntplugin"],"contributors":[{"name":"Travis Hilterbrand","url":"http://github.com/travis-hilterbrand"}],"_id":"grunt-file-creator@0.1.1","dist":{"shasum":"1523ac948743cffc805449869af389cf8329e23e","tarball":"https://registry.npmjs.org/grunt-file-creator/-/grunt-file-creator-0.1.1.tgz","integrity":"sha512-IzToAWhrtUYrOiz1Nl5LgdJP2DfiI7f8evUd9QHuGjavLZSAua6HjHz2stHWRlxSmbpTG4yQ/aytFkoykyJcTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXY80Xs8jFHric2V2puM7uUV7697j78i9Kvoht2/3dSAiEA8gOvOH+e/9SwC/Sa++O+NnnsaLpOXgpgDZYzRI02jjU="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thilterbrand","email":"travis_hilterbrand@yahoo.com"},"maintainers":[{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"}]},"0.1.2":{"name":"grunt-file-creator","description":"Creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).","version":"0.1.2","homepage":"https://github.com/travis-hilterbrand/grunt-file-creator","author":{"name":"Travis Hilterbrand","url":"https://github.com/travis-hilterbrand/grunt-file-creator"},"repository":{"type":"git","url":"git://github.com/travis-hilterbrand/grunt-file-creator.git"},"bugs":{"url":"https://github.com/travis-hilterbrand/grunt-file-creator/issues"},"licenses":[{"type":"MIT","url":"https://github.com/travis-hilterbrand/grunt-file-creator/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":"*"},"scripts":{"test":"./node_modules/.bin/grunt test"},"dependencies":{},"devDependencies":{"grunt":"~0.4","grunt-contrib-clean":"~0.5.0","grunt-contrib-jshint":"~0.1.0","grunt-contrib-nodeunit":"~0.1.0","node-fs":"~0.1.7"},"keywords":["gruntplugin"],"contributors":[{"name":"Travis Hilterbrand","url":"http://github.com/travis-hilterbrand"}],"_id":"grunt-file-creator@0.1.2","dist":{"shasum":"42635d6c463c32b9a77662eb7059b5efbed106d6","tarball":"https://registry.npmjs.org/grunt-file-creator/-/grunt-file-creator-0.1.2.tgz","integrity":"sha512-TMZQPANrt/jhJ50mv/Dka7CHN0FjCHvTqesG5c/emA6cQtRHIgX1fqosEZ7qK08jBvuHH2/7mIOEI/dQapW31Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+kNXXBoYa46kIZkVJAJv43uwJbGVnAQuf/h1LMztYMwIhAJ70yHOND0AAIYPvSlO+/VzTiqaenuHBmnHyZc2SW7w9"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"thilterbrand","email":"travis_hilterbrand@yahoo.com"},"maintainers":[{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"}]},"0.1.3":{"name":"grunt-file-creator","description":"Creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).","version":"0.1.3","homepage":"https://github.com/travis-hilterbrand/grunt-file-creator","author":{"name":"Travis Hilterbrand","url":"https://github.com/travis-hilterbrand/grunt-file-creator"},"repository":{"type":"git","url":"git://github.com/travis-hilterbrand/grunt-file-creator.git"},"bugs":{"url":"https://github.com/travis-hilterbrand/grunt-file-creator/issues"},"licenses":[{"type":"MIT","url":"https://github.com/travis-hilterbrand/grunt-file-creator/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":"*"},"scripts":{"test":"grunt test"},"dependencies":{},"devDependencies":{"grunt":"~0.4","grunt-contrib-clean":"~0.5.0","grunt-contrib-jshint":"~0.1.0","grunt-contrib-nodeunit":"~0.1.0","node-fs":"~0.1.7"},"keywords":["gruntplugin"],"contributors":[{"name":"Travis Hilterbrand","url":"http://github.com/travis-hilterbrand"}],"gitHead":"fbbea6589e0118972fb9b1f2ff2439469de982e1","_id":"grunt-file-creator@0.1.3","_shasum":"63d22d50680a4839ed83b4ad12d4a351aaebe003","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.17","_npmUser":{"name":"thilterbrand","email":"travis_hilterbrand@yahoo.com"},"maintainers":[{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"}],"dist":{"shasum":"63d22d50680a4839ed83b4ad12d4a351aaebe003","tarball":"https://registry.npmjs.org/grunt-file-creator/-/grunt-file-creator-0.1.3.tgz","integrity":"sha512-Jl3/ANlbMgjuqy9zVWOIf6U3f0rlT9Xb/3hCqjsonL1h92hXbMpU/V17nvOXsx1H3qA4NbPEVaBtDQcjckCVcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDfbeol9v+ChrHWa9FxZQKseo7ka5p4cdTZCagNEvfAAiEA0sd8Y6dnZscBSfCXjWaIJuLinpt1nzXmlqwkb45uyYo="}]}}},"readme":"grunt-file-creator\n==================\n\nA grunt task that creates/writes to files from Javascript functions in the grunt config (useful for config files, etc).\n\n####_Grunt ~0.4 Required_\n\n## Getting Started\n_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._\n\nFrom the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:\n\n```bash\nnpm install grunt-file-creator --save-dev\n```\n\nOnce that's done, add this line to your project's Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-file-creator');\n```\n\nIf the plugin has been installed correctly, running `grunt --help` at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a `devDependency`, which ensures that it will be installed whenever the `npm install` command is run.\n\n[grunt]: http://gruntjs.com/\n[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md\n[package.json]: https://npmjs.org/doc/json.html\n\n\n## The file-creator task\n\n### Overview\n\nThis task is a multi task so any targets, files and options should be specified according to the multi task documentation.\n\n### Options\n\n#### openFlags\nType: `String`  \nDefault: 'w'\n\nThe flags passed to the open file method.\n\n[See the node.js fs docs for more info](http://nodejs.org/api/fs.html)\n\n### Usage Examples\n\n#### Write a file\n\nIn this example, running `grunt file-creator:basic` (or `grunt file-creator` because `file-creator` is a [multi task]()) will write a simple string to the file *basic.txt* under the folder *dist*.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  \"file-creator\": {\n    \"basic\": {\n      \"dist/basic.txt\": function(fs, fd, done) {\n        fs.writeSync(fd, 'some basic text');\n        done();\n      }\n    }\n  }\n});\n```\n\n#### Iterating a folder and writing the contents to a file.\n\nIn this example, running `grunt file-creator:folder` (or `grunt file-creator` because `file-creator` is a [multi task]()) will write the filtered contents of a folder to the file *folder.txt* under the folder *dist*.  \n\nThe filtering is performed using the glob included with grunt (node-glob).\n\nThe glob operation is asynchronous.  The target iteration performed by file-creator will wait until the done() method is called before moving on to the next target.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  \"file-creator\": {\n    options: {\n      openFlags: 'w'\n    },\n    \"folder\": {\n      \"dist/folder.txt\": function(fs, fd, done) {\n          var glob = grunt.file.glob;\n          var _ = grunt.util._;\n          glob('test/fixtures/sample/**/*.js', function (err, files) {\n            var widgets = [];\n            _.each(files, function(file) {\n              widgets.push(file);\n            });\n\n            fs.writeSync(fd, '// this file is auto-generated.  DO NOT MODIFY\\n');\n            _.each(widgets, function(file, i) {\n              fs.writeSync(fd, file + ':' + i + '\\n');\n            });\n            done();\n          });\n        }\n      }\n    }\n  }\n});\n```\n\n#### Specifying filenames conditionally using grunt templates\n\nFor more information, see the grunt documentation on templates (http://gruntjs.com/api/grunt.template).\n\n```js\n  grunt.initConfig({\n    conditional: {\n      file: 'conditional.txt'\n    },\n\n    \"file-creator\": {\n      \"conditional\": {\n        files: [\n          {\n            file: \"tmp/\" + '<%= conditional.file %>',\n            method: function(fs, fd, done) {\n              fs.writeSync(fd, 'filenames can be set using grunt templates');\n              done();\n            }\n          }\n        ]\n      }\n    }\n  });\n```\n\n#### Specifying filenames on the command line using grunt options\n\nFor more information, see the grunt documentation on options (http://gruntjs.com/api/grunt.option).\n\nUsing this command line, the file can be set conditionally using options.\n<pre>\ngrunt file-creator --option-name=myfile.txt\n</pre>\n\n\n```js\n  grunt.initConfig({\n      \"option\": {\n        files: [\n          {\n            file: \"tmp/\" + (grunt.option('option-name') || 'option.txt'),\n            method: function(fs, fd, done) {\n              fs.writeSync(fd, 'filenames can be set as grunt options (passed on the command line)');\n              done();\n            }\n          }\n        ]\n      }\n    }\n  });\n\n```\n\n\nFor fully-working examples, see the test folder.\n","maintainers":[{"name":"thilterbrand","email":"travis-hilterbrand@yahoo.com"}],"time":{"modified":"2022-06-18T14:59:19.627Z","created":"2012-12-08T00:18:15.058Z","0.0.1":"2012-12-08T00:18:16.156Z","0.0.2":"2012-12-08T00:53:56.345Z","0.1.0":"2013-02-22T03:40:16.815Z","0.1.1":"2013-10-02T07:11:57.949Z","0.1.2":"2014-08-20T03:22:07.209Z","0.1.3":"2015-04-08T04:36:37.297Z"},"author":{"name":"Travis Hilterbrand","url":"https://github.com/travis-hilterbrand/grunt-file-creator"},"repository":{"type":"git","url":"git://github.com/travis-hilterbrand/grunt-file-creator.git"},"users":{"furzeface":true,"derothenbergiii":true,"saidgeek":true},"homepage":"https://github.com/travis-hilterbrand/grunt-file-creator","keywords":["gruntplugin"],"contributors":[{"name":"Travis Hilterbrand","url":"http://github.com/travis-hilterbrand"}],"bugs":{"url":"https://github.com/travis-hilterbrand/grunt-file-creator/issues"},"readmeFilename":"README.md"}