{ "name": "grunt-banner", "description": "Adds a simple banner to files", "version": "0.1.4", "homepage": "https://github.com/mattstyles/grunt-banner", "author": { "name": "Matt Styles", "email": "matt@veryfizzyjelly.com", "url": "veryfizzyjelly.com" }, "repository": { "type": "git", "url": "git://github.com/mattstyles/grunt-banner.git" }, "bugs": { "url": "https://github.com/mattstyles/grunt-banner/issues" }, "licenses": [ { "type": "MIT", "url": "https://github.com/mattstyles/grunt-banner/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", "grunt-cli": "~0.1.7" }, "peerDependencies": { "grunt": "~0.4.1" }, "keywords": [ "gruntplugin" ], "readme": "# grunt-banner [![Build Status](https://travis-ci.org/mattstyles/grunt-banner.png?branch=master)](https://travis-ci.org/mattstyles/grunt-banner)\n\n> Adds a simple banner to 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-banner --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-banner');\n```\n\nOr if you are using [matchdep](https://github.com/tkellen/node-matchdep) it will be included along with other\n`grunt-*` tasks by using this line of JS:\n\n```js\nrequire('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);\n```\n\n## The \"usebanner\" task\n\n_grunt-banner renamed it’s task from `banner` to `usebanner` as a `banner` is often used to hold a banner template\nfor a number of grunt plugins_\n\n### Overview\nIn your project's Gruntfile, add a section named `usebanner` to the data object passed into `grunt.initConfig()`.\n\nThe wildcard selector `*` is perfectly valid for selecting targets to add a banner to.\n\n```js\ngrunt.initConfig({\n usebanner: {\n taskName: {\n options: {\n position: 'top' || 'bottom'\n banner: '// banner text <%= templates encouraged %>'\n },\n files: {\n src: [ 'path/to/file.ext', 'path/to/another/*.ext' ]\n }\n }\n }\n})\n```\n\n### Options\n\n#### options.position\nType: `String`\nDefault value: `'top`\nValue range: `'top'` or `'bottom'` only\n\nThe position to place the banner - _either_ the top or bottom (other values will default to top)\n\n#### options.banner\nType: `String`\nDefault value: ``\n\nThe text to use as a banner. Templated strings are perfectly acceptable and encouraged.\n\n### Usage Examples\n\nIn this example an `appConfig` is read from a JSON file and used to populate a `banner` template which\nis then used by `grunt-banner` to place at the top of some files. Each file in the array will have the\nbanner placed on to it and all `.js` files in the `/more-scripts/` folder will have a banner thanks to\nthe `*` wildcard.\n\n```js\nvar appConfig = grunt.file.readJSON( 'app-config.json' ) || {};\ngrunt.initConfig({\n banner: '/* <%= appConfig.info.name %> - version <%= appConfig.info.version %> - ' +\n '<%= grunt.template.today(\"dd-mm-yyyy\") %>\\n' +\n '<%= appConfig.info.description %>\\n ' +\n '© <%= grunt.template.today(\"yyyy\") %> <%= appConfig.info.author.name %> ' +\n '- <%= appConfig.info.author.email %> */\\n',\n usebanner: {\n dist: {\n options: {\n position: 'top'\n banner: '<%= banner %>'\n },\n files: {\n src: [ 'scripts/main-min.js', 'stylesheets/main-min.css', 'more-scripts/*.js' ]\n }\n }\n }\n})\n```\n\n### Notes\n\n`grunt-banner` simply adds the banner to the head or foot of the files that are specified by\nthe array passed to `files.src`, it makes no attempt to see if a banner already exists and it\nis up to the user to ensure that the file should not already contain a banner. To this end it is\nstrongly recommended to use the [grunt-contrib-clean](https://github.com/gruntjs/grunt-contrib-clean)\ntask and only add banners to production-ready code.\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* 01.05.03 -- v0.1.4 -- Fix for wildcard selector\n* 01.05.13 -- v0.1.3 -- Added travis\n* 30.04.13 -- v0.1.0 -- Initial release of grunt-banner\n", "readmeFilename": "README.md", "_id": "grunt-banner@0.1.4", "_from": "grunt-banner@0.1.4", "dist": { "shasum": "93d7c29395f7a33a039a231344e4a6fdd6fa28ea" }, "_resolved": "https://registry.npmjs.org/grunt-banner/-/grunt-banner-0.1.4.tgz" }