{"_id":"grunt-directives","_rev":"38-030bcea5c6f3b3b5b2573faad449b017","name":"grunt-directives","description":"Simple grunt task to use include directives in your files","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"grunt-directives","description":"Simple grunt task to use include directives in your files","version":"0.1.0","homepage":"https://github.com/dciccale/grunt-directives","author":{"name":"Denis Ciccale","email":"dciccale@gmail.com"},"repository":{"type":"git","url":"git://github.com/dciccale/grunt-directives.git"},"bugs":{"url":"https://github.com/dciccale/grunt-directives/issues"},"licenses":[{"type":"MIT","url":"https://github.com/dciccale/grunt-directives/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt-contrib-jshint":"~0.1.1","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.1.2","grunt":"~0.4.1"},"peerDependencies":{"grunt":"~0.4.1"},"keywords":["gruntplugin"],"_id":"grunt-directives@0.1.0","dist":{"shasum":"82553f3e816f555df1013f860419d57fe84cab63","tarball":"https://registry.npmjs.org/grunt-directives/-/grunt-directives-0.1.0.tgz","integrity":"sha512-u5Hp36E9h23hPspy0Ai0OO0JTAnSkJxpayrJnSzYgqq5xDsUGGgs6lM1KzE/qqblfVmNVfHFmrlmIXhu2Uo9CA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3AqXYpmsDGB1p0eHALmNQe1gdSRSLQz/k0+OtsN6vvAiEAr1LzaYuITVor9/8q74zw4a5n4LGQP6UGsLm59uMx4zQ="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"denis","email":"dciccale@gmail.com"},"maintainers":[{"name":"denis","email":"dciccale@gmail.com"}],"directories":{}},"0.1.1":{"name":"grunt-directives","description":"Simple grunt task to use include directives in your files","version":"0.1.1","homepage":"https://github.com/dciccale/grunt-directives","author":{"name":"Denis Ciccale","email":"dciccale@gmail.com"},"repository":{"type":"git","url":"git://github.com/dciccale/grunt-directives.git"},"bugs":{"url":"https://github.com/dciccale/grunt-directives/issues"},"licenses":[{"type":"MIT","url":"https://github.com/dciccale/grunt-directives/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"0.4.x","grunt-contrib-jshint":"0.5.x","grunt-contrib-clean":"0.4.x","grunt-contrib-nodeunit":"0.1.x"},"keywords":["gruntplugin","include","directives"],"_id":"grunt-directives@0.1.1","dist":{"shasum":"4efa0e07608d318e4dd82caea66edd496c162d0e","tarball":"https://registry.npmjs.org/grunt-directives/-/grunt-directives-0.1.1.tgz","integrity":"sha512-xNCvAdJnaCAuyiiWdhexOw1Ryp+XS4t+oeOUfp4u+piEVOWRpxbagFi3JBpHhVX4U7jjhZdqO8twpCk7g51M9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0aiNBgHNgy4B4vB1LNqyV2Oq7WMSdlxeNcz1ipsmneAiAVPBIVwuUmueQk/JvK+RWusJI4wYDAeqC9JokdhGHYUA=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"denis","email":"dciccale@gmail.com"},"maintainers":[{"name":"denis","email":"dciccale@gmail.com"}],"directories":{}},"0.1.2":{"name":"grunt-directives","description":"Simple grunt task to use include directives in your files","version":"0.1.2","homepage":"https://github.com/dciccale/grunt-directives","author":{"name":"Denis Ciccale","email":"dciccale@gmail.com"},"repository":{"type":"git","url":"git://github.com/dciccale/grunt-directives.git"},"bugs":{"url":"https://github.com/dciccale/grunt-directives/issues"},"licenses":[{"type":"MIT","url":"https://github.com/dciccale/grunt-directives/blob/master/LICENSE-MIT"}],"main":"Gruntfile.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"0.4.x","grunt-contrib-jshint":"0.6.x","grunt-contrib-nodeunit":"0.2.x"},"keywords":["grunt","gruntplugin","include","directives","build"],"_id":"grunt-directives@0.1.2","dist":{"shasum":"c9422e6d4fa745c96872b6a561bf6201273967e7","tarball":"https://registry.npmjs.org/grunt-directives/-/grunt-directives-0.1.2.tgz","integrity":"sha512-r66IePOs1TKmc74IFhZ1BV3qxhbLaYkosv3dztPaeO3UPpOcwdOYdDM4OOt0xiyiScpuZIKwo3Y1naAJuiSANw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGgrHNnNNeV7q7SyHoUrm3HxPbhZhT3gkIl/0pokKmOFAiEAzqT0yv7NazamT7BF+bYECtPidXrK/LadCDtZ/ezPsZk="}]},"_from":".","_npmVersion":"1.2.25","_npmUser":{"name":"denis","email":"dciccale@gmail.com"},"maintainers":[{"name":"denis","email":"dciccale@gmail.com"}]}},"readme":"# grunt-directives [![Build Status](https://travis-ci.org/dciccale/grunt-directives.png?branch=master)](https://travis-ci.org/dciccale/grunt-directives) [![NPM version](https://badge.fury.io/js/grunt-directives.png)](http://badge.fury.io/js/grunt-directives)\n\n> Simple grunt task to use directives in your files\n\n## Getting Started\nThis plugin requires Grunt `~0.4.1`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-directives --save-dev\n```\n\nOne the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-directives');\n```\n\n## The \"directives\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `directives` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  directives: {\n    options: {\n      // Task-specific options go here.\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n    },\n  },\n})\n```\n\n### Options\n\n#### separator\nType: `String`\nDefault: `grunt.util.linefeed`\n\nConcatenated files will be joined on this string. If you're post-processing concatenated JavaScript files with a minifier, you may need to use a semicolon `';'` as the separator.\n\n#### banner\nType: `String`\nDefault: empty string\n\nThis string will be prepended to the beginning of the concatenated output. It is processed using [grunt.template.process][], using the default options.\n\n_(Default processing options are explained in the [grunt.template.process][] documentation)_\n\n#### footer\nType: `String`\nDefault: empty string\n\nThis string will be appended to the end of the concatenated output. It is processed using [grunt.template.process][], using the default options.\n\n_(Default processing options are explained in the [grunt.template.process][] documentation)_\n\n### Usage Examples\n\nIn this example, running `grunt directives:dist` (or `grunt directives` because `directives` is a [multi task][]) will process the specified source files (in order), joining files with `;`, process them to look for `@include` directives and writing the output to `dist/built.js`.\n\nSuppose you have a `test.js` file with this content:\n```js\nvar included = false;\n\n// @include file1.js\n\nif (included) {\n  console.log('file1.js was included successfully!');\n}\n```\n\nWhere `file1.js` is:\n```js\nincluded = true;\n```\n\nNow define the directives task in grunt:\n\n```js\ngrunt.initConfig({\n  directives: {\n    options: {\n      separator: ';'\n    },\n    dist: {\n      src: ['test.js'],\n      dest: 'dist/built.js'\n    }\n  }\n});\n```\n\nThis can also be done with html:\n\nSuppose you have a `test.html` file with this content:\n```html\n<html>\n  ...\n  <body>\n    <!-- @include content.html -->\n  </body>\n</html>\n```\n\nWhere `content.html` is:\n```html\n<p>Hello world!</p>\n```\n\nAnd the result will be:\n\n```html\n<html>\n  ...\n  <body>\n    <p>Hello world!</p>\n  </body>\n</html>\n```\n\n#### Banner comments\n\nIn this example, running `grunt directives:dist` will first concatenate the source files, process them to look for `@include` directives and concatenate a newly-generated banner comment at the top, writing the output to `dist/built.js`.\n\nThis generated banner will be the contents of the `banner` template string interpolated with the config object. In this case, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date.\n\n_Note: you don't have to use an external JSON file. It's also valid to create the `pkg` object inline in the config. That being said, if you already have a JSON file, you might as well reference it._\n\n```js\ngrunt.initConfig({\n  pkg: grunt.file.readJSON('package.json'),\n  concat: {\n    options: {\n      banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +\n        '<%= grunt.template.today(\"yyyy-mm-dd\") %> */'\n    },\n    dist: {\n      src: ['src/project.js'],\n      dest: 'dist/built.js'\n    }\n  }\n});\n```\n\n### Supported directives\n- include\n- *more to come...*\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n\n- 0.1.0 Initial release\n","maintainers":[{"name":"denis","email":"dciccale@gmail.com"}],"time":{"modified":"2022-06-18T14:51:46.477Z","created":"2013-05-05T15:05:47.552Z","0.1.0":"2013-05-05T15:05:51.398Z","0.1.1":"2013-05-24T10:49:13.771Z","0.1.2":"2013-06-12T10:29:05.003Z"},"author":{"name":"Denis Ciccale","email":"dciccale@gmail.com"},"repository":{"type":"git","url":"git://github.com/dciccale/grunt-directives.git"},"users":{"fgribreau":true},"homepage":"https://github.com/dciccale/grunt-directives","keywords":["grunt","gruntplugin","include","directives","build"],"bugs":{"url":"https://github.com/dciccale/grunt-directives/issues"},"readmeFilename":"README.md"}