{"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"keywords":["buffer","streaming","stream","async","abstract"],"dist-tags":{"latest":"1.1.1"},"author":{"name":"Nicolas Froidure","url":"http://www.insertafter.com/blog.html"},"description":"Abstract streams to deal with the whole buffered contents.","readme":"# BufferStreams\n\n[![NPM version](https://img.shields.io/npm/v/bufferstreams.svg)](https://www.npmjs.com/package/bufferstreams)\n[![Build Status](https://travis-ci.org/nfroidure/BufferStreams.svg?branch=master)](https://travis-ci.org/nfroidure/BufferStreams)\n[![Dependency Status](https://david-dm.org/nfroidure/bufferstreams.svg)](https://david-dm.org/nfroidure/bufferstreams)\n[![devDependency Status](https://david-dm.org/nfroidure/bufferstreams/dev-status.svg)](https://david-dm.org/nfroidure/bufferstreams#info=devDependencies)\n[![Coverage Status](https://coveralls.io/repos/nfroidure/BufferStreams/badge.svg?branch=master)](https://coveralls.io/r/nfroidure/BufferStreams?branch=master)\n[![Code Climate](https://codeclimate.com/github/nfroidure/BufferStreams/badges/gpa.svg)](https://codeclimate.com/github/nfroidure/BufferStreams)\n\n`bufferstreams` abstracts streams to allow you to deal with their whole content\n in a single buffer when it becomes necessary (by example: a legacy library that\n do not support streams).\n\nIt is not a good practice, just some glue. Using `bufferstreams` means:\n* there is no library dealing with streams for your needs\n* you filled an issue to the wrapped library to support streams\n\n`bufferstreams` can also be used to control the whole stream content in a single\n point of a streaming pipeline for testing purposes.\n\n## Usage\nInstall the [npm module](https://npmjs.org/package/bufferstreams):\n```sh\nnpm install bufferstreams --save\n```\nThen, in your scripts:\n```js\nvar fs = require('fs');\nvar bufferstreams = require('bufferstreams');\n\nfs.createReadStream('input.txt')\n  .pipe(new bufferstreams(function(err, buf, cb) {\n\n    // err will be filled with an error if the piped in stream emits one.\n    if(err) {\n      throw err;\n    }\n\n    // buf will contain the whole piped in stream contents\n    buf = Buffer(buf.toString('utf-8').replace('foo', 'bar'));\n\n    // cb is a callback to pass the result back to the piped out stream\n    // first argument is an error that will be emitted if any\n    // the second argument is the modified buffer\n    cb(null, buf);\n\n  }))\n  .pipe(fs.createWriteStream('output.txt'));\n```\n\nNote that you can use `bufferstreams` with the objectMode option. In this case,\n the given buffer will be an array containing the streamed objects:\n```js\nnew BufferStreams({objectMode: true}, myCallback);\n```\n\n## API\n\n### Stream : BufferStreams([options], callback)\n\n#### options\n\n##### options.objectMode\nType: `Boolean`\nDefault value: `false`\n\nUse if piped in streams are in object mode. In this case, an array of the\n buffered will be transmitted to the `callback` function.\n\n##### options.*\n\n`bufferstreams` inherits of Stream.Duplex, the options are passed to the\n parent constructor so you can use it's options too.\n\n##### callback(err, buf, cb)\nType: `Function`, required.\n\nA function to handle the buffered content.\n\n## Stats\n\n[![NPM](https://nodei.co/npm/bufferstreams.png?downloads=true&stars=true)](https://nodei.co/npm/bufferstreams/)\n[![NPM](https://nodei.co/npm-dl/bufferstreams.png)](https://nodei.co/npm/bufferstreams/)\n\n## Contributing\nFeel free to pull your code if you agree with publishing it under the MIT license.\n","repository":{"type":"git","url":"git://github.com/nfroidure/BufferStreams.git"},"users":{"t1st3":true},"bugs":{"url":"https://github.com/nfroidure/BufferStreams/issues"},"license":"MIT","versions":{"0.0.1":{"name":"bufferstreams","version":"0.0.1","description":"Abstract streams to deal with the whole buffered contents.","homepage":"https://github.com/nfroidure/BufferStreams","main":"src/index.js","scripts":{"test":"mocha tests/*.mocha.js"},"repository":{"type":"git","url":"git://github.com/nfroidure/BufferStreams"},"keywords":["buffer","streaming","stream","async","abstract"],"devDependencies":{"mocha":"1.x.x","event-stream":"1.x.x"},"author":{"name":"Nicolas Froidure","url":"http://www.insertafter.com/blog.html"},"engines":{"node":">= 0.10.0"},"licenses":[{"type":"MIT","url":"https://github.com/nfroidure/BufferStreams/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/nfroidure/BufferStreams/issues"},"_id":"bufferstreams@0.0.1","dist":{"shasum":"6ba7773de6acb6eb85dbce710c321808c79be849","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/bufferstreams/-/bufferstreams-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"directories":{}},"0.0.2":{"name":"bufferstreams","version":"0.0.2","description":"Abstract streams to deal with the whole buffered contents.","homepage":"https://github.com/nfroidure/BufferStreams","main":"src/index.js","scripts":{"test":"./node_modules/mocha/bin/mocha tests/*.mocha.js","coveralls":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","cover":"./node_modules/istanbul/lib/cli.js cover --report html ./node_modules/mocha/bin/_mocha -- tests/*.mocha.js -R spec -t 5000","trinity":"npm-check-updates -u && npm test && git commit package.json -m \"Dependencies update\" && git push"},"repository":{"type":"git","url":"git://github.com/nfroidure/BufferStreams"},"keywords":["buffer","streaming","stream","async","abstract"],"devDependencies":{"mocha":"1.x.x","event-stream":"3.x.x","mocha-lcov-reporter":"0.0.1","coveralls":"~2.8.0","istanbul":"~0.2.6"},"author":{"name":"Nicolas Froidure","url":"http://www.insertafter.com/blog.html"},"engines":{"node":">= 0.10.0"},"licenses":[{"type":"MIT","url":"https://github.com/nfroidure/BufferStreams/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/nfroidure/BufferStreams/issues"},"dependencies":{"readable-stream":"^1.0.26-2"},"_id":"bufferstreams@0.0.2","dist":{"shasum":"7ce8dff968bbac00b9e90158a2c41456f740abdd","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/bufferstreams/-/bufferstreams-0.0.2.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"directories":{}},"1.0.1":{"name":"bufferstreams","version":"1.0.1","description":"Abstract streams to deal with the whole buffered contents.","homepage":"https://github.com/nfroidure/BufferStreams","main":"src/index.js","scripts":{"test":"./node_modules/mocha/bin/mocha tests/*.mocha.js","coveralls":"./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage","cover":"./node_modules/istanbul/lib/cli.js cover --report html ./node_modules/mocha/bin/_mocha -- tests/*.mocha.js -R spec -t 5000","trinity":"npm-check-updates -u && npm test && git commit package.json -m \"Dependencies update\" && git push"},"repository":{"type":"git","url":"git://github.com/nfroidure/BufferStreams"},"keywords":["buffer","streaming","stream","async","abstract"],"devDependencies":{"coveralls":"~2.11.2","istanbul":"~0.3.5","mocha":"2.x.x","mocha-lcov-reporter":"0.0.1","streamtest":"^1.1.0"},"author":{"name":"Nicolas Froidure","url":"http://www.insertafter.com/blog.html"},"engines":{"node":">= 0.10.0"},"licenses":[{"type":"MIT","url":"https://github.com/nfroidure/BufferStreams/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/nfroidure/BufferStreams/issues"},"dependencies":{"readable-stream":"^1.0.33"},"gitHead":"7d4c975accd17ea382845d93e11761ad8c364534","_id":"bufferstreams@1.0.1","_shasum":"cfb1ad9568d3ba3cfe935ba9abdd952de88aab2a","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"dist":{"shasum":"cfb1ad9568d3ba3cfe935ba9abdd952de88aab2a","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/bufferstreams/-/bufferstreams-1.0.1.tgz"},"directories":{}},"1.0.2":{"name":"bufferstreams","version":"1.0.2","description":"Abstract streams to deal with the whole buffered contents.","homepage":"https://github.com/nfroidure/BufferStreams","main":"src/index.js","scripts":{"test":"mocha tests/*.mocha.js","coveralls":"istanbul cover _mocha --report lcovonly -- tests/*.mocha.js -t 5000 && istanbul-coveralls","cover":"istanbul cover --report html _mocha -- tests/*.mocha.js -t 5000","trinity":"npm-check-updates -u && npm install && npm test && git commit package.json -m \"Dependencies update\" && git push"},"repository":{"type":"git","url":"git://github.com/nfroidure/BufferStreams"},"keywords":["buffer","streaming","stream","async","abstract"],"dependencies":{"readable-stream":"^2.0.0"},"devDependencies":{"istanbul":"^0.3.15","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"^0.0.2","streamtest":"^1.2.1"},"author":{"name":"Nicolas Froidure","url":"http://www.insertafter.com/blog.html"},"engines":{"node":">= 0.10.0"},"licenses":[{"type":"MIT","url":"https://github.com/nfroidure/BufferStreams/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/nfroidure/BufferStreams/issues"},"gitHead":"8aaf7a576177d3c2c1e626d8bfba091d47d7cea3","_id":"bufferstreams@1.0.2","_shasum":"37643de45f8f84875503111284e7c38b56b8d54f","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"dist":{"shasum":"37643de45f8f84875503111284e7c38b56b8d54f","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/bufferstreams/-/bufferstreams-1.0.2.tgz"},"directories":{}},"1.1.0":{"name":"bufferstreams","version":"1.1.0","description":"Abstract streams to deal with the whole buffered contents.","homepage":"https://github.com/nfroidure/BufferStreams","main":"src/index.js","scripts":{"test":"mocha tests/*.mocha.js","coveralls":"istanbul cover _mocha --report lcovonly -- tests/*.mocha.js -t 5000 && istanbul-coveralls","cover":"istanbul cover --report html _mocha -- tests/*.mocha.js -t 5000","trinity":"npm-check-updates -u && npm install && npm test && git commit package.json -m \"Dependencies update\" && git push","lint":"eslint **/*.s","cli":"env NPM_RUN_CLI=1"},"repository":{"type":"git","url":"git://github.com/nfroidure/BufferStreams"},"keywords":["buffer","streaming","stream","async","abstract"],"dependencies":{"readable-stream":"^2.0.2"},"devDependencies":{"eslint":"^1.0.0","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"^0.0.2","sf-lint":"^1.0.2","streamtest":"^1.2.1"},"author":{"name":"Nicolas Froidure","url":"http://www.insertafter.com/blog.html"},"engines":{"node":">= 0.10.0"},"licenses":[{"type":"MIT","url":"https://github.com/nfroidure/BufferStreams/blob/master/LICENSE"}],"bugs":{"url":"https://github.com/nfroidure/BufferStreams/issues"},"gitHead":"8b3f9058764b4ff8095df90eea55ea7683d3ee33","_id":"bufferstreams@1.1.0","_shasum":"073cd120308c0678ee7d7c48b69e06eb4538ade0","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"nfroidure","email":"nfroidure@elitwork.com"},"dist":{"shasum":"073cd120308c0678ee7d7c48b69e06eb4538ade0","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/bufferstreams/-/bufferstreams-1.1.0.tgz"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"directories":{}},"1.1.1":{"name":"bufferstreams","version":"1.1.1","description":"Abstract streams to deal with the whole buffered contents.","homepage":"https://github.com/nfroidure/BufferStreams","main":"src/index.js","files":["src"],"scripts":{"test":"mocha tests/*.mocha.js","coveralls":"istanbul cover _mocha --report lcovonly -- tests/*.mocha.js -t 5000 && istanbul-coveralls","cover":"istanbul cover --report html _mocha -- tests/*.mocha.js -t 5000","trinity":"npm-check-updates -u && npm install && npm test && git commit package.json -m \"Dependencies update\" && git push","lint":"eslint **/*.s","cli":"env NPM_RUN_CLI=1"},"repository":{"type":"git","url":"git://github.com/nfroidure/BufferStreams.git"},"keywords":["buffer","streaming","stream","async","abstract"],"dependencies":{"readable-stream":"^2.0.2"},"devDependencies":{"eslint":"^1.0.0","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"^0.0.2","sf-lint":"^1.0.2","streamtest":"^1.2.1"},"author":{"name":"Nicolas Froidure","url":"http://www.insertafter.com/blog.html"},"engines":{"node":">= 0.10.0"},"license":"MIT","bugs":{"url":"https://github.com/nfroidure/BufferStreams/issues"},"gitHead":"acd18756a3066c72b4cff8aa79aa44a3dcb4f85f","_id":"bufferstreams@1.1.1","_shasum":"0161373060ac5988eff99058731114f6e195d51e","_from":".","_npmVersion":"3.10.2","_nodeVersion":"4.4.5","_npmUser":{"name":"shinnn","email":"snnskwtnb@gmail.com"},"dist":{"shasum":"0161373060ac5988eff99058731114f6e195d51e","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/bufferstreams/-/bufferstreams-1.1.1.tgz"},"maintainers":[{"name":"nfroidure","email":"nfroidure@elitwork.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/bufferstreams-1.1.1.tgz_1467112826909_0.5332817453891039"},"directories":{}}},"name":"bufferstreams","time":{"modified":"2016-06-28T11:20:27.340Z","created":"2014-01-05T11:38:58.156Z","0.0.1":"2014-01-05T11:39:00.914Z","0.0.2":"2014-03-29T06:52:47.160Z","1.0.1":"2015-02-09T18:01:35.797Z","1.0.2":"2015-06-21T07:12:43.424Z","1.1.0":"2015-08-04T09:49:52.922Z","1.1.1":"2016-06-28T11:20:27.340Z"},"readmeFilename":"README.md","homepage":"https://github.com/nfroidure/BufferStreams"}