{"name":"base-pipeline","description":"base-methods plugin that adds pipeline and plugin methods for dynamically composing streaming plugin pipelines.","version":"0.2.4","homepage":"https://github.com/node-base/base-pipeline","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/node-base/base-pipeline.git"},"bugs":{"url":"https://github.com/node-base/base-pipeline/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"extend-shallow":"^2.0.1","kind-of":"^3.0.2","lazy-cache":"^1.0.3","stream-combiner":"^0.2.2","through2":"^2.0.0"},"devDependencies":{"base":"^0.6.7","base-config":"^0.4.0","base-fs":"^0.3.0","base-option":"^0.6.1","base-plugins":"^0.4.1","buffer-equal":"^1.0.0","composer":"^0.11.1","graceful-fs":"^4.1.3","gulp":"^3.9.0","gulp-eslint":"^1.0.0","gulp-format-md":"^0.1.5","gulp-istanbul":"^0.10.2","gulp-jshint":"^1.11.2","gulp-mocha":"^2.1.3","jshint-stylish":"^2.1.0","mocha":"*","rimraf":"^2.5.1","should":"*","sinon":"^1.17.3","vinyl":"^1.1.1"},"keywords":["base","baseplugin","file","fs","system","vinyl"],"verb":{"run":true,"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["base-cli","base-config","base-data","base-methods","base-options","base-plugins","base-store"]},"reflinks":["verb"],"lint":{"reflinks":true}},"gitHead":"9244a4e887c1f2015a52bbeae79821e7dad0d222","_id":"base-pipeline@0.2.4","_shasum":"f90d332141dd5590bdcbffd65146e77ded994137","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"f90d332141dd5590bdcbffd65146e77ded994137","tarball":"http://registry-npm.ywwl.com/base-pipeline/download/base-pipeline-0.2.4.tgz","integrity":"sha512-1wrfrNEdXvJH1mPzMFR2MlAjW24jJ6gQg5tbdCfiVQL7lh1HbGYd4wrzTFIQN5yHti2fmGGVHdLuMn/cF6BaTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICeM7wVgJRHhNDV97riqKhO2PXJUDbZQZ15RnqfsYQElAiAgge7l6yfOHN+APtY/bl5ykLFsy/73g7M19UBM4Tf8Zg=="}],"size":4232,"noattachment":false,"key":"/base-pipeline/-/base-pipeline-0.2.4.tgz"},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/base-pipeline-0.2.4.tgz_1458218291862_0.5969660463742912"},"directories":{},"readme":"# base-pipeline [![NPM version](https://img.shields.io/npm/v/base-pipeline.svg?style=flat)](https://www.npmjs.com/package/base-pipeline) [![NPM downloads](https://img.shields.io/npm/dm/base-pipeline.svg?style=flat)](https://npmjs.org/package/base-pipeline) [![Build Status](https://img.shields.io/travis/node-base/base-pipeline.svg?style=flat)](https://travis-ci.org/node-base/base-pipeline)\n\nbase-methods plugin that adds pipeline and plugin methods for dynamically composing streaming plugin pipelines.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install base-pipeline --save\n```\n\n## Usage\n\n```js\nvar base = require('base-methods');\nvar pipeline = require('base-pipeline');\nvar bfs = require('base-fs');\n\n// create your application and add the plugin\nvar app = base()\n  .use(pipeline())\n  .use(bfs)\n\n// plugins may return a function\napp.plugin('a', function() {\n  return through.obj(function(file, enc, next) {\n    next(null, file);\n  });\n});\n\n// or a stream\napp.plugin('b', through.obj(function(file, enc, next) {\n  next(null, file);\n}));\n\n// use registered plugins\napp.src(['foo/*.hbs'])\n  .pipe(app.pipeline(['a', 'b']))\n  .pipe(app.dest('site/'))\n```\n\n## Supported signatures\n\n**Array of registered plugin names:**\n\n```js\n// register plugins\napp.plugin('a', function() {});\napp.plugin('b', function() {});\n\n// pipeline\napp.src(['foo/*.hbs'])\n  .pipe(app.pipeline(['a', 'b']))\n  .pipe(app.dest('site/'))\n```\n\n**List of registed plugin names:**\n\n```js\n// register plugins\napp.plugin('a', function() {});\napp.plugin('b', function() {});\n\n// pipeline\napp.src(['foo/*.hbs'])\n  .pipe(app.pipeline('a', 'b'))\n  .pipe(app.dest('site/'))\n```\n\n**Stacked:**\n\n```js\n// register plugins\napp.plugin('a', function() {});\napp.plugin('b', function() {});\napp.plugin('c', function() {});\n\n// pipeline\napp.src(['foo/*.hbs'])\n  .pipe(app.pipeline('a'))\n  .pipe(app.pipeline('b'))\n  .pipe(app.pipeline('c'))\n  .pipe(app.dest('site/'))\n```\n\n**Functions that return a stream:**\n\n```js\napp.src(['foo/*.hbs'])\n  .pipe(app.pipeline(function() {\n    return through.obj(function(file, enc, next) {\n      next(null, file);  \n    })\n  }))\n  .pipe(app.pipeline(function() {\n    return through.obj(function(file, enc, next) {\n      next(null, file);  \n    })\n  }))\n  .pipe(app.dest('site/'))\n```\n\n**Streams:**\n\nIn general, it's a best practice for plugins to return a function that returns a stream. This ensures that every time the function is called a new stream is returned.\n\n```js\napp.src(['foo/*.hbs'])\n  .pipe(app.pipeline(through.obj(function(file, enc, next) {\n    next(null, file);  \n  }))\n  .pipe(app.pipeline(through.obj(function(file, enc, next) {\n    next(null, file);  \n  }))\n  .pipe(app.dest('site/'))\n```\n\n## Related projects\n\nYou might also be interested in these projects:\n\n* [base-cli](https://www.npmjs.com/package/base-cli): Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… [more](https://www.npmjs.com/package/base-cli) | [homepage](https://github.com/node-base/base-cli)\n* [base-config](https://www.npmjs.com/package/base-config): base-methods plugin that adds a `config` method for mapping declarative configuration values to other 'base'… [more](https://www.npmjs.com/package/base-config) | [homepage](https://github.com/node-base/base-config)\n* [base-data](https://www.npmjs.com/package/base-data): adds a `data` method to base-methods. | [homepage](https://github.com/node-base/base-data)\n* [base-methods](https://www.npmjs.com/package/base-methods): base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://www.npmjs.com/package/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods)\n* [base-options](https://www.npmjs.com/package/base-options): Adds a few options methods to base-methods, like `option`, `enable` and `disable`. See the readme… [more](https://www.npmjs.com/package/base-options) | [homepage](https://github.com/jonschlinkert/base-options)\n* [base-plugins](https://www.npmjs.com/package/base-plugins): Upgrade's plugin support in base applications to allow plugins to be called any time after… [more](https://www.npmjs.com/package/base-plugins) | [homepage](https://github.com/node-base/base-plugins)\n* [base-store](https://www.npmjs.com/package/base-store): Plugin for getting and persisting config values with your base-methods application. Adds a 'store' object… [more](https://www.npmjs.com/package/base-store) | [homepage](https://github.com/node-base/base-store)\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/node-base/base-pipeline/issues/new).\n\n## Building docs\n\nGenerate readme and API documentation with [verb](https://github.com/verbose/verb):\n\n```sh\n$ npm install verb && npm run docs\n```\n\nOr, if [verb](https://github.com/verbose/verb) is installed globally:\n\n```sh\n$ verb\n```\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d && npm test\n```\n\n## Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/node-base/base-pipeline/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 25, 2016._","publish_time":1458218294352,"_cnpm_publish_time":1458218294352,"dist-tags":{"latest":"0.3.2"}}