UNPKG

webproxy

Version:

Modify http request/response in javascript config file easily.

60 lines (59 loc) 4.35 kB
{ "name": "gulp-header", "version": "1.2.2", "description": "Gulp extension to add header to file(s) in the pipeline.", "main": "./index.js", "proxy": null, "https-proxy": null, "directories": { "test": "test" }, "scripts": { "test": "mocha --reporter spec" }, "repository": { "type": "git", "url": "git://github.com/tracker1/gulp-header.git" }, "keywords": [ "header", "gulpplugin", "eventstream" ], "author": { "name": "Michael J. Ryan", "email": "mxryan@godaddy.com", "url": "http://github.com/tracker1" }, "contributors": [ { "name": "GoDaddy.com", "url": "http://github.com/godaddy" }, { "name": "Douglas Duteil", "email": "douglasduteil@gmail.com", "url": "http://github.com/douglasduteil" } ], "license": "MIT", "bugs": { "url": "https://github.com/tracker1/gulp-header/issues" }, "dependencies": { "gulp-util": "*", "object-assign": "*", "through2": "*" }, "devDependencies": { "event-stream": "^3.1.7", "mocha": "*", "should": "*", "vinyl": "*" }, "readme": "The canonical location of this project is now [tracker1/gulp-header](https://github.com/tracker1/gulp-header).\r\n\r\n# gulp-header [![NPM version](https://badge.fury.io/js/gulp-header.png)](http://badge.fury.io/js/gulp-header) [![Build Status](https://travis-ci.org/tracker1/gulp-header.png)](https://travis-ci.org/tracker1/gulp-header)\r\n\r\ngulp-header is a [Gulp](https://github.com/gulpjs/gulp) extension to add a header to file(s) in the pipeline. [Gulp is a streaming build system](https://github.com/gulpjs/gulp) utilizing [node.js](http://nodejs.org/).\r\n\r\n```javascript\r\nvar header = require('gulp-header');\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\nvar header = require('gulp-header');\r\n\r\ngulp.src('./foo/*.js')\r\n .pipe(header('Hello'))\r\n .pipe(gulp.dest('./dist/')\r\n\r\ngulp.src('./foo/*.js')\r\n .pipe(header('Hello <%= name %>\\n', { name : 'World'} ))\r\n .pipe(gulp.dest('./dist/')\r\n\r\ngulp.src('./foo/*.js')\r\n .pipe(header('Hello ${name}\\n', { name : 'World'} ))\r\n .pipe(gulp.dest('./dist/')\r\n\r\n\r\n//\r\n\r\n\r\nvar pkg = require('./package.json');\r\nvar banner = ['/**',\r\n ' * <%= pkg.name %> - <%= pkg.description %>',\r\n ' * @version v<%= pkg.version %>',\r\n ' * @link <%= pkg.homepage %>',\r\n ' * @license <%= pkg.license %>',\r\n ' */',\r\n ''].join('\\n');\r\n\r\ngulp.src('./foo/*.js')\r\n .pipe(header(banner, { pkg : pkg } ))\r\n .pipe(gulp.dest('./dist/')\r\n \r\n\r\n//\r\n\r\n\r\nvar fs = require('fs');\r\n\r\ngulp.src('./foo/*.js')\r\n .pipe(header(fs.readFileSync('header.txt', 'utf8'), { pkg : pkg } ))\r\n .pipe(gulp.dest('./dist/')\r\n```\r\n\r\n## API\r\n\r\n### header(text, data)\r\n\r\n#### text\r\n\r\nType: `String` \r\nDefault: `''` \r\n\r\nThe template text.\r\n\r\n\r\n#### data\r\n\r\nType: `Object` \r\nDefault: `{}` \r\n\r\nThe data object used to populate the text.\r\n\r\n## License\r\n\r\n```\r\nThe MIT License (MIT)\r\n\r\nCopyright (c) 2013 GoDaddy.com\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of\r\nthis software and associated documentation files (the \"Software\"), to deal in\r\nthe Software without restriction, including without limitation the rights to\r\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r\nthe Software, and to permit persons to whom the Software is furnished to do so,\r\nsubject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n```\r\n", "readmeFilename": "README.md", "homepage": "https://github.com/tracker1/gulp-header", "_id": "gulp-header@1.2.2", "_from": "gulp-header@^1.2.2" }