{"_id":"@bretkikehara/gulp-wrap","_rev":"4-091fc150afc0863ebbad0cb6b8d7d977","name":"@bretkikehara/gulp-wrap","description":"A gulp plugin to wrap the stream contents with a template.","dist-tags":{"latest":"0.14.2"},"versions":{"0.14.0":{"name":"@bretkikehara/gulp-wrap","version":"0.14.0","description":"A gulp plugin to wrap the stream contents with a template.","repository":{"type":"git","url":"git+https://github.com/adamayres/gulp-wrap.git"},"author":{"name":"Adam Ayres","email":"magicaj@gmail.com","url":"https://github.com/adamayres"},"contributors":[{"name":"Shinnosuke Watanabe","email":"snnskwtnb@gmail.com","url":"https://github.com/shinnn"}],"licenses":[{"type":"MIT","url":"https://github.com/adamayres/gulp-wrap/blob/master/LICENSE"}],"files":["index.js"],"scripts":{"pretest":"jscs *.js test/test.js && eslint *.js test/test.js","test":"_mocha","coverage":"istanbul cover _mocha","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"keywords":["gulpplugin","wrap","template","lodash","consolidate","gulp"],"dependencies":{"consolidate":"^0.14.1","es6-promise":"^3.1.2","fs-readfile-promise":"^2.0.1","gulp-util":"^3.0.3","js-yaml":"^3.2.6","lodash":"^4.11.1","node.extend":"^1.1.2","through2":"^2.0.1","tryit":"^1.0.1","vinyl-bufferstream":"^1.0.1"},"devDependencies":{"eslint":"^2.9.0","expect.js":"^0.3.1","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.1","jscs":"^3.0.3","mocha":"^2.1.0","simple-bufferstream":"1.0.0","vinyl":"^1.1.1"},"engines":{"node":">=0.10","npm":">=1.4.3"},"jscsConfig":{"preset":"google","maximumLineLength":98,"requireBlocksOnNewline":true,"validateLineBreaks":"LF"},"gitHead":"4ae9cd68d7d66e9974fa1336ab51262c52bb3e6e","bugs":{"url":"https://github.com/adamayres/gulp-wrap/issues"},"homepage":"https://github.com/adamayres/gulp-wrap#readme","_id":"@bretkikehara/gulp-wrap@0.14.0","_shasum":"cc88d23c02932e7c5e0cd4571b10836fdcbecae4","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"bretkikehara","email":"bret.k.ikehara@gmail.com"},"dist":{"shasum":"cc88d23c02932e7c5e0cd4571b10836fdcbecae4","tarball":"https://registry.npmjs.org/@bretkikehara/gulp-wrap/-/gulp-wrap-0.14.0.tgz","integrity":"sha512-vB0mfS/R4yxO01RcJP2m5s5WlucKl3b3p9XRpIxTThpKQ+k+wtNDL9Vp7pxp3HLZtDgKlK1In33hWtFmKRWIAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo3wkMdXNIPMJrkjSVsO9nrRIQ2AC1dIgfCq+oDL+4gwIhANzGeT1J9fWr0exnOiAvvpaQHH3jGSiazZfHLD6VxLb9"}]},"maintainers":[{"name":"bretkikehara","email":"bret.k.ikehara@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-wrap-0.14.0.tgz_1501528751392_0.577797292964533"}},"0.14.1":{"name":"@bretkikehara/gulp-wrap","version":"0.14.1","description":"A gulp plugin to wrap the stream contents with a template.","repository":{"type":"git","url":"git+https://github.com/adamayres/gulp-wrap.git"},"author":{"name":"Adam Ayres","email":"magicaj@gmail.com","url":"https://github.com/adamayres"},"contributors":[{"name":"Shinnosuke Watanabe","email":"snnskwtnb@gmail.com","url":"https://github.com/shinnn"}],"licenses":[{"type":"MIT","url":"https://github.com/adamayres/gulp-wrap/blob/master/LICENSE"}],"files":["index.js"],"scripts":{"pretest":"jscs *.js test/test.js && eslint *.js test/test.js","test":"_mocha","coverage":"istanbul cover _mocha","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"keywords":["gulpplugin","wrap","template","lodash","consolidate","gulp"],"dependencies":{"consolidate":"^0.14.1","es6-promise":"^3.1.2","fs-readfile-promise":"^2.0.1","gulp-util":"^3.0.3","js-yaml":"^3.2.6","lodash":"^4.11.1","node.extend":"^1.1.2","through2":"^2.0.1","tryit":"^1.0.1","vinyl-bufferstream":"^1.0.1"},"devDependencies":{"eslint":"^2.9.0","expect.js":"^0.3.1","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.1","jscs":"^3.0.3","mocha":"^2.1.0","simple-bufferstream":"1.0.0","vinyl":"^1.1.1"},"engines":{"node":">=0.10","npm":">=1.4.3"},"jscsConfig":{"preset":"google","maximumLineLength":98,"requireBlocksOnNewline":true,"validateLineBreaks":"LF"},"gitHead":"55c1434ce5652731e023c2fe7db82bd54dd3f3ad","bugs":{"url":"https://github.com/adamayres/gulp-wrap/issues"},"homepage":"https://github.com/adamayres/gulp-wrap#readme","_id":"@bretkikehara/gulp-wrap@0.14.1","_shasum":"2e7a2879322ff13993574bb9d6463c98d439bcb9","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"bretkikehara","email":"bret.k.ikehara@gmail.com"},"dist":{"shasum":"2e7a2879322ff13993574bb9d6463c98d439bcb9","tarball":"https://registry.npmjs.org/@bretkikehara/gulp-wrap/-/gulp-wrap-0.14.1.tgz","integrity":"sha512-J/z/OcnYuxUX/m0BTCWp8RYbGfTbkR6xbnj6h+eiZtgvK9+ojP4EV+W/L7pD3Ak1mamyZLV2qV/vNIkDyMbRTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErxnj4MZlA5b1EXU9F1XasTh6eXHl+Ow+zjR49zYPzOAiEAjlQNudhzLi7Asmu0T24RPoTwlYMKsHiftycytwob6c0="}]},"maintainers":[{"name":"bretkikehara","email":"bret.k.ikehara@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-wrap-0.14.1.tgz_1501530937665_0.2104414312634617"}},"0.14.2":{"name":"@bretkikehara/gulp-wrap","version":"0.14.2","description":"A gulp plugin to wrap the stream contents with a template.","repository":{"type":"git","url":"git+https://github.com/adamayres/gulp-wrap.git"},"author":{"name":"Adam Ayres","email":"magicaj@gmail.com","url":"https://github.com/adamayres"},"contributors":[{"name":"Shinnosuke Watanabe","email":"snnskwtnb@gmail.com","url":"https://github.com/shinnn"}],"licenses":[{"type":"MIT","url":"https://github.com/adamayres/gulp-wrap/blob/master/LICENSE"}],"files":["index.js"],"scripts":{"pretest":"jscs *.js test/test.js && eslint *.js test/test.js","test":"_mocha","coverage":"istanbul cover _mocha","coveralls":"${npm_package_scripts_coverage} && istanbul-coveralls"},"keywords":["gulpplugin","wrap","template","lodash","consolidate","gulp"],"dependencies":{"consolidate":"^0.14.1","es6-promise":"^3.1.2","fs-readfile-promise":"^2.0.1","gulp-util":"^3.0.3","js-yaml":"^3.2.6","lodash":"^4.11.1","node.extend":"^1.1.2","through2":"^2.0.1","tryit":"^1.0.1","vinyl-bufferstream":"^1.0.1"},"devDependencies":{"eslint":"^2.9.0","expect.js":"^0.3.1","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.1","jscs":"^3.0.3","mocha":"^2.1.0","simple-bufferstream":"1.0.0","vinyl":"^1.1.1"},"engines":{"node":">=0.10","npm":">=1.4.3"},"jscsConfig":{"preset":"google","maximumLineLength":98,"requireBlocksOnNewline":true,"validateLineBreaks":"LF"},"gitHead":"d0f235802cab73a7ee856219b693022281ca3c05","bugs":{"url":"https://github.com/adamayres/gulp-wrap/issues"},"homepage":"https://github.com/adamayres/gulp-wrap#readme","_id":"@bretkikehara/gulp-wrap@0.14.2","_shasum":"f4498a4bfb6d72ed87fd425a8e5c688fd95f4942","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"bretkikehara","email":"bret.k.ikehara@gmail.com"},"dist":{"shasum":"f4498a4bfb6d72ed87fd425a8e5c688fd95f4942","tarball":"https://registry.npmjs.org/@bretkikehara/gulp-wrap/-/gulp-wrap-0.14.2.tgz","integrity":"sha512-eGBbRLuASlZN9Ci2yp+EZa/Gvx10kVjYWjWoiAp1MQJuofoBfwiQlRGCyUMFslgRNty7zmBf1abyjKZFLkHVig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLjZEPwCaL0bJwAPGIYZW3yvK/ssJJ6MLXRxidN3s5bgIhAINZGgmGhenNelNI4IOPBy0kLynD4YXxzEm/KCsKbecC"}]},"maintainers":[{"name":"bretkikehara","email":"bret.k.ikehara@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-wrap-0.14.2.tgz_1501531556776_0.6246737856417894"}}},"readme":"# gulp-wrap\n\n[![NPM version](https://img.shields.io/npm/v/gulp-wrap.svg?style=flat)](https://www.npmjs.com/package/gulp-wrap)\n[![Build Status](https://secure.travis-ci.org/adamayres/gulp-wrap.svg?branch=master)](http://travis-ci.org/adamayres/gulp-wrap)\n[![Coverage Status](https://img.shields.io/coveralls/adamayres/gulp-wrap.svg?style=flat)](https://coveralls.io/r/adamayres/gulp-wrap)\n[![Dependency Status](https://img.shields.io/david/adamayres/gulp-wrap.svg?style=flat&label=deps)](https://david-dm.org/adamayres/gulp-wrap)\n[![devDependency Status](https://img.shields.io/david/dev/adamayres/gulp-wrap.svg?style=flat&label=devDeps)](https://david-dm.org/adamayres/gulp-wrap#info=devDependencies)\n\n> A [gulp](https://github.com/gulpjs/gulp) plugin to wrap the stream contents with a [lodash](http://lodash.com/docs#template) template.\n\n## Usage\n\nFirst, install `gulp-wrap` as a development dependency:\n\n```shell\nnpm install --save-dev gulp-wrap\n```\n\nThen, add it to your `gulpfile.js`:\n\n**Wrap the contents with an inline template:**\n\n```javascript\nvar wrap = require(\"gulp-wrap\");\n\ngulp.src(\"./src/*.json\")\n    .pipe(wrap('angular.module(\\'text\\', []).value(<%= contents %>);', {}, { parse: false /* do not parse the JSON file for template data */ }))\n    .pipe(gulp.dest(\"./dist\"));\n```\n\n**Wrap the contents with a template from file:**\n\n```javascript\nvar wrap = require(\"gulp-wrap\");\n\ngulp.src(\"./src/*.json\")\n    .pipe(wrap({ src: 'path/to/template.txt'}))\n    .pipe(gulp.dest(\"./dist\"));\n```\n\n**Use parsed contents within a template (supports JSON and YAML):**\n\n```javascript\nvar wrap = require(\"gulp-wrap\");\n\ngulp.src(\"./src/*.json\")\n    .pipe(wrap('Hello, <%= contents.title %>, have a <%= contents.adjective %> day.'))\n    .pipe(gulp.dest(\"./dist\"));\n```\n\n**Provide additional data and options for template processing:**\n\n```javascript\nvar wrap = require(\"gulp-wrap\");\n\ngulp.src(\"./src/*.json\")\n    .pipe(wrap('BEFORE <%= data.contents %> <%= data.someVar %> AFTER', { someVar: 'someVal'}, { variable: 'data' }))\n    .pipe(gulp.dest(\"./dist\"));\n```\n\nThis gulp plugin wraps the stream contents in a template. If you want the stream contents to be the templates use the [gulp-template](https://github.com/sindresorhus/gulp-template) plugin.\n\n## Template\n\nThe stream contents will be available in the template using the `contents` key. If the file extension is `json`, `yaml`, or `yml` then the contents will be parsed before being passed to the template. Properties from the vinyl file will be available in the template under the `file` object and are local to that stream. User supplied `data` values will always take precedence over namespace clashes with the file properties.\n\n## API\n\n### wrap(template\\[,data\\]\\[,options\\])\n\n#### template\nType: `String` or `Object` or `Function`\n\nThe template to used. When a `String` then it will be used as the template. When an `Object` then the template will be loaded from file. When a `Function` then the function will be called and should return the template content. This function get the `data` object as first parameter.\n\n#### template.src\nType: `String`\n\nThe file location of the template.\n\n#### data\nType: `Object` or `Function`\n\nThe data object that is passed on to the [lodash](http://lodash.com/docs#template) template call. When a `Function` then the function will be called and should return the `Object` data used in the template.  \n\n#### options\nType: `Object` or `Function`\n\nThe options object that is passed on to the [lodash](http://lodash.com/docs#template) template call. When a `Function` then the function will be called and should return the `Object` used as the options.\n\n#### options.parse\nType: `Boolean`\n\nSet to explicit `false` value to disable automatic JSON and YAML parsing.\n\n#### options.engine\nType: `String`\n\nSet the [consolidate template engine](https://www.npmjs.com/package/consolidate) to use. (default to `lodash`).\nUsing another engine that `lodash` may require installation of additional node package.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n","maintainers":[{"name":"bretkikehara","email":"bret.k.ikehara@gmail.com"}],"time":{"modified":"2022-06-12T15:29:03.509Z","created":"2017-07-31T19:19:11.465Z","0.14.0":"2017-07-31T19:19:11.465Z","0.14.1":"2017-07-31T19:55:37.790Z","0.14.2":"2017-07-31T20:05:56.842Z"},"homepage":"https://github.com/adamayres/gulp-wrap#readme","keywords":["gulpplugin","wrap","template","lodash","consolidate","gulp"],"repository":{"type":"git","url":"git+https://github.com/adamayres/gulp-wrap.git"},"contributors":[{"name":"Shinnosuke Watanabe","email":"snnskwtnb@gmail.com","url":"https://github.com/shinnn"}],"author":{"name":"Adam Ayres","email":"magicaj@gmail.com","url":"https://github.com/adamayres"},"bugs":{"url":"https://github.com/adamayres/gulp-wrap/issues"},"readmeFilename":"README.md"}