{"_id":"pass-stream","_rev":"1500343","name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through (streams2)","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"time":{"modified":"2026-10-01T09:50:10.000Z","created":"2012-11-22T15:38:15.892Z","1.0.0":"2017-03-03T21:32:09.463Z","0.1.5":"2016-02-26T18:26:14.152Z","0.1.3":"2013-08-06T16:01:57.035Z","0.1.2":"2013-07-09T23:41:14.174Z","0.1.1":"2013-04-12T21:42:13.550Z","0.1.0":"2013-04-01T21:05:11.705Z","0.0.7":"2013-03-23T21:06:12.916Z","0.0.6":"2012-11-22T15:38:15.892Z"},"users":{"butterkekstorte":true},"author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/jeffbski/pass-stream.git"},"versions":{"1.0.0":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through (streams2)","version":"1.0.0","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.10"},"dependencies":{},"devDependencies":{"mocha":"~1.9.0","chai":"~1.5.0","chai-stack":"~1.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","streams2","filter","transform","through","pipe","pause","drain","buffer"],"gitHead":"221f788c218d5f0c5f4c32775c4e4cfb064d9a91","homepage":"https://github.com/jeffbski/pass-stream#readme","_id":"pass-stream@1.0.0","_shasum":"72850ad6b20ff7a2724a780f50e2506200b61e82","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"dist":{"shasum":"72850ad6b20ff7a2724a780f50e2506200b61e82","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-1.0.0.tgz","integrity":"sha512-hqejLFE/hk60iSdC1ucocFL7dufoUO7W6H4l5247LJu8e+vjjvrQdVDuL2zKqwK6ohdz8HsvA63Ny05kJVIO7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHiuRJhAwueXrPfN6sHtS0kybiIlOWAKmrUkt5Z2bQ1NAiEA8DbRHJgMmkM5qy1fdGo2gmsj+02kV3y3jMud+NaOrec="}],"size":4858,"noattachment":false,"key":"/pass-stream/-/pass-stream-1.0.0.tgz"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/pass-stream-1.0.0.tgz_1488576727102_0.7907904300373048"},"publish_time":1488576729463,"_cnpm_publish_time":1488576729463},"0.1.5":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through (streams2)","version":"0.1.5","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"http://github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.8"},"dependencies":{"readable-stream":"https://github.com/jeffbski/readable-stream/archive/v1.0.2-object-transform2-ret-self.tar.gz"},"devDependencies":{"mocha":"~1.9.0","chai":"~1.5.0","chai-stack":"~1.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","streams2","filter","transform","through","pipe","pause","drain","buffer"],"gitHead":"70a6ecde09ffee490f3b26620ed1602f4e321485","homepage":"https://github.com/jeffbski/pass-stream","_id":"pass-stream@0.1.5","_shasum":"9e3afa4d5825cdd1376075bdb56de36dfb33649f","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.0","_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"dist":{"shasum":"9e3afa4d5825cdd1376075bdb56de36dfb33649f","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-0.1.5.tgz","integrity":"sha512-pGa0s6MkFFPNs9tN3tYbZTaelRX8YIvsb/qmaJ3zjoMd5IJwOvy+sMvdieUDV03MF0O+dklnwG3hJBb2RYbxFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCa517LrDlNqDJ4VRvS/Hc8j+K02TSeFDuf1ONdBZfRBQIgUvCAkKuSgFA5BpRvHJ/NEwMhRelwm1EiezRpsdBl0Hw="}],"size":5082,"noattachment":false,"key":"/pass-stream/-/pass-stream-0.1.5.tgz"},"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/pass-stream-0.1.5.tgz_1456511172923_0.9470404733438045"},"publish_time":1456511174152,"_cnpm_publish_time":1456511174152},"0.1.3":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through (streams2)","version":"0.1.3","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"http://github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.8"},"dependencies":{"readable-stream":"https://github.com/jeffbski/readable-stream/archive/v1.0.2-object-transform2-ret-self.tar.gz"},"devDependencies":{"mocha":"~1.9.0","chai":"~1.5.0","chai-stack":"~1.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","streams2","filter","transform","through","pipe","pause","drain","buffer"],"_id":"pass-stream@0.1.3","dist":{"shasum":"b72bd72b43fb5a10244a8752d06248ed2ae8d11c","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-0.1.3.tgz","integrity":"sha512-AeU+HTIv+ro+yNXw9asW78dvdkRQ7ieZx7Tgl3kv2rsg6LPPCtoIOWmIJ17lZMEjnbQkvtbkK+oLOMu+kXF8rw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAXgCo+5qicI80x7550t/usbg0ZJF+OjaII7ruQU4SbAiEA1WzgtpIA1Q9vYlD3n/aKFR+dYEMMOGwRKSceoTTcyp8="}],"size":4881,"noattachment":false,"key":"/pass-stream/-/pass-stream-0.1.3.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"publish_time":1375804917035,"_cnpm_publish_time":1375804917035},"0.1.2":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through (streams2)","version":"0.1.2","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"http://github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.8"},"dependencies":{"readable-stream":"https://github.com/jeffbski/readable-stream/tarball/v1.0.2-object-transform2"},"devDependencies":{"mocha":"~1.9.0","chai":"~1.5.0","chai-stack":"~1.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","streams2","filter","transform","through","pipe","pause","drain","buffer"],"_id":"pass-stream@0.1.2","dist":{"shasum":"a72d4dc14544b42a3271607a446304ff7f93bc44","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-0.1.2.tgz","integrity":"sha512-9GMYjLI9YIshnBaroJGhn5UluHg1JvlWyGok6dHCiYP8NsGO2ZcnnlgQ3J/xXQHkFbKYZ8nS8YAwvaw9A/SzNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFpMfLSE9m4iblBnzUJxdrZUw2AzH+UOsTQNbnPGWGy4AiEA+tHS0X0fA6S74PNu+lvaaWZMosBxIPmQnm1V4Xhk3Y8="}],"size":4871,"noattachment":false,"key":"/pass-stream/-/pass-stream-0.1.2.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"publish_time":1373413274174,"_cnpm_publish_time":1373413274174},"0.1.1":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through (streams2)","version":"0.1.1","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"http://github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.8"},"dependencies":{"readable-stream":"https://github.com/jeffbski/readable-stream/tarball/v1.0.2-object-transform"},"devDependencies":{"mocha":"~1.9.0","chai":"~1.5.0","chai-stack":"~1.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","streams2","filter","transform","through","pipe","pause","drain","buffer"],"_id":"pass-stream@0.1.1","dist":{"shasum":"94d7d1344040d5965a1e5f3b385ba74d2a9f60f4","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-0.1.1.tgz","integrity":"sha512-yU5LBSE9W97J59zatxofvjPxt5sZUdmV0awM5I7mHGQoZWxp11gNOBxttHf5MF6KCq4eF3xTdfpzsaYscrsjig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7w5Xl26e/XC/ikoze2OIVT4aNG9pQOZNjzJu/qKtN1wIhAIAb0khYLm2x6rJFmsmHWtTj3/rUS32z0WqgDrNtyf5U"}],"size":4866,"noattachment":false,"key":"/pass-stream/-/pass-stream-0.1.1.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"publish_time":1365802933550,"_cnpm_publish_time":1365802933550},"0.1.0":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through","version":"0.1.0","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"http://github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.8"},"dependencies":{"readable-stream":"https://github.com/jeffbski/readable-stream/tarball/v1.0.2-object-transform"},"devDependencies":{"mocha":"~1.8.2","chai":"~1.5.0","chai-stack":"~1.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","filter","transform","through","pipe","pause","drain","buffer"],"_id":"pass-stream@0.1.0","dist":{"shasum":"33073ebffb2185f00d0014478bd41cb4e56fc22c","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-0.1.0.tgz","integrity":"sha512-T8JMZ6Y7cV84Jhy/SktJ4EDXsGtVJAkmRGJ9KcWdDnlgiSkVOXrbQVyx+txG7+U/wifiloZ/mEeSicXNNy1hqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEDlP+WUAfuJrg7qmxh5FYVNbV4a4+kqPRPMUg4W6/x9AiEAk7sWQ1X3Bpe3rZbNIE4TA4Y5MeU6lweAThC19EGodI0="}],"size":6040,"noattachment":false,"key":"/pass-stream/-/pass-stream-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.15","_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"publish_time":1364850311705,"_cnpm_publish_time":1364850311705},"0.0.7":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through","version":"0.0.7","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"http://github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.8"},"dependencies":{"pause-stream":"=0.0.7"},"devDependencies":{"mocha":"~1.8.2","chai":"~1.5.0","chai-stack":"~1.3.1","stream-tester":"~0.0.5","stream-spec":"~0.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","filter","transform","through","pipe","pause","drain","buffer"],"_id":"pass-stream@0.0.7","dist":{"shasum":"7b2dc11447be84d14903e3ae1417d5a40c6f0b74","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-0.0.7.tgz","integrity":"sha512-oxi7MClbIqFJyepnwXf/JrKLMFtBGqLI7/JjWRJyB1Ne8P03zISNgNpO3BqSwZdNO9LFQl/LtrH6IrPhQjmOXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPcdezI8n9CKgZiha49RkrPudT7KBCLNnIBDn5t3idnwIhAKKJa54tu+FQAv1tqB8jpazKuUvj3c8Hql89c0KfIVOi"}],"size":6115,"noattachment":false,"key":"/pass-stream/-/pass-stream-0.0.7.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"publish_time":1364072772916,"_cnpm_publish_time":1364072772916},"0.0.6":{"name":"pass-stream","description":"pass-through stream which can filter/adapt and pause data as it passes through","version":"0.0.6","author":{"name":"Jeff Barczewski","email":"jeff.barczewski@gmail.com"},"repository":{"type":"git","url":"git://github.com/jeffbski/pass-stream.git"},"bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"},"licenses":[{"type":"MIT","url":"http://github.com/jeffbski/pass-stream/raw/master/LICENSE"}],"main":"lib/pass-stream","engines":{"node":">=0.8"},"dependencies":{"pause-stream":"~0.0.6"},"devDependencies":{"mocha":"~1.6.0","chai":"~1.3.0","chai-stack":"~1.3.1","stream-tester":"~0.0.3","stream-spec":"~0.3.1"},"scripts":{"test":"./node_modules/mocha/bin/mocha ./test/*.mocha.js"},"keywords":["stream","filter","transform","through","pipe","pause","drain","buffer"],"_npmUser":{"name":"jeffbski","email":"jeff.barczewski@gmail.com"},"_id":"pass-stream@0.0.6","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.8.14","_defaultsLoaded":true,"dist":{"shasum":"38a8d3e1998133b6fcffcd6be74292cd2b1ac828","tarball":"http://registry-npm.ywwl.com/pass-stream/download/pass-stream-0.0.6.tgz","integrity":"sha512-FUpUUAf4W+P9KL+mS6o4VShjJfqvNkkEc/Nemk3zFddoGi40nT7yF4MzjfIJPc4LwN3ZxRDlaHeBIZqJDAFfVg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJymVbo3OkYwfkNYDTIK8P7QtEvyPYXrpXOtw45lW3GwIgC4JxXBZnpFja3Ge3vo0J49PiqrjUtk0WmprDu05Mchc="}],"size":5696,"noattachment":false,"key":"/pass-stream/-/pass-stream-0.0.6.tgz"},"maintainers":[{"name":"jeffbski","email":"jeff.barczewski@gmail.com"}],"publish_time":1353598695892,"_cnpm_publish_time":1353598695892}},"readme":"# pass-stream - pass-through node.js stream which can filter/adapt and pause data\n\npass-stream is a pass-through stream which allows transform fns for easily filtering or adapting the data that flows through the stream.\n\nIt is a light wrapper over the new (streams2) readable-stream functionality which is available as add in for node 0.8 and is built-in for node 0.10+\n\n[![Build Status](https://secure.travis-ci.org/jeffbski/pass-stream.png?branch=master)](http://travis-ci.org/jeffbski/pass-stream)\n\n## Installation\n\n```bash\nnpm install pass-stream\n```\n\n## Usage\n\n - `passStream(writeFn, endFn, options)` optional writeFn, endFn, and options. Returns a pauseable stream which can be piped or used like any other. Options are the same as for standard streams (for instance set objectMode = true to allow arbitrary non-null objects to be used.\n\n\n```javascript\nvar passStream = require('pass-stream');\nvar ps = passStream(); // constructing stream without any transformations\nreadStream\n  .pipe(ps)\n  .pipe(anotherStream)\n```\n\nTo add transform/filter functionality you may provide a writeFn and/or endFn which allows you to tap into the write and end processing.\n\nIf you provide a writeFn, then it is up to you to call `this.push(data)` with whatever transformed data and call the cb. The writeFn has signature `writeFn(chunk, encoding, cb)`\n\nIf you provide an endFn, then it will be be fired after all the data has been read but before the `end` event has been fired. You may do additional `this.push(data)` and then call the cb when done. hooked up as a listener for `on('end')`. The endFn has signature `endFn(cb)`.\n\nThe `cb` functions provided in writeFn and endFn can call the callback with an error if they wish to signal an error to the stream, ex: `cb(new Error('bad...'))`\n\nThe `this` context of the writeFn and endFn is set to that of the stream so you have all the normal stream functions like `emit`, `pause`, and `resume`. Note: you will not want to call `write` or `end` from within these functions since they will cause a recursive loop.\n\n```javascript\nvar passStream = require('pass-stream');\n  var length = 0;\n  function writeFn(data, encoding, cb) { // we are assuming data is strings\n    this.push(data.toUpperCase());  // upper case\n    length += data.length;  // keep track of length\n    cb();\n  }\n  function endFn(cb) {\n    this.emit('length', length); // emit length now that it is done\n    cb();\n  }\n  var lengthResult = 0;\n  var options = {};\n  var rstream = new Stream();\n  rstream\n    .pipe(passStream(writeFn, endFn, options))  // construct a passStream with transformFns\n    .on('length', function (len) { lengthResult = len; })\n    .pipe(anotherStream);\n```\n\n\n## Goals\n\n - Easily use new streams2 functionality (readable-streams) with node 0.8 or 0.10+\n - Built-in buffering pause capability (from streams2)\n - Easy to use transformation filters with the stream\n - Act as the base to build other specific pass through streams with\n - Tested\n - Allows any datatype (except null or undefined) to be used in the stream (String, Buffer, Number, Boolean, Array, Object)\n\n## Why\n\nWhile node 0.8 is still needed, this creates easy wrapper to allow for the transition to node 0.10\n\n\n## Get involved\n\nIf you have input or ideas or would like to get involved, you may:\n\n - contact me via twitter @jeffbski  - <http://twitter.com/jeffbski>\n - open an issue on github to begin a discussion - <https://github.com/jeffbski/pass-stream/issues>\n - fork the repo and send a pull request (ideally with tests) - <https://github.com/jeffbski/pass-stream>\n\n## License\n\n - [MIT license](http://github.com/jeffbski/pass-stream/raw/master/LICENSE)\n","_attachments":{},"homepage":"https://github.com/jeffbski/pass-stream#readme","bugs":{"url":"http://github.com/jeffbski/pass-stream/issues"}}