{"name":"slice-stream","version":"0.0.0","description":"Pipe data through a stream until some fixed length is reached, then callback.","main":"slicestream.js","directories":{"example":"examples","test":"test"},"scripts":{"test":"./node_modules/.bin/tap ./test/*.js"},"repository":{"type":"git","url":"https://github.com/EvanOxfeld/slice-stream.git"},"keywords":["slice","fixed","length","stream","split"],"author":{"name":"Evan Oxfeld","email":"eoxfeld@gmail.com"},"license":"MIT","gitHead":"9054cbab67c2e71ab9241dbe88401c786b270f8e","dependencies":{"readable-stream":"~1.0.2"},"devDependencies":{"stream-buffers":"~0.2.4","tap":"~0.4.0"},"_id":"slice-stream@0.0.0","dist":{"shasum":"8183df87ad44ae0b48c0625134eac6e349747860","tarball":"http://registry-npm.ywwl.com/slice-stream/download/slice-stream-0.0.0.tgz","integrity":"sha512-c5vDCTXM/cF1S+urIpcGKQ1ROW4mL5venjOuELZFKllSSHsjOH4eAXQDjtCE5PKaY9+EfEeXurx/rp0IDqiHHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJvthhPi7vV9xBgptZXUtUOXv+I2oosDbmaDVi0wgYCQIhANlTFZbsaAcK+zllxIfWQ4RWWSnnIj/3+V2fWeyQTzP7"}],"size":6550,"noattachment":false,"key":"/slice-stream/-/slice-stream-0.0.0.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"evanoxfeld","email":"eoxfeld@gmail.com"},"maintainers":[{"name":"evanoxfeld","email":"eoxfeld@gmail.com"}],"readme":"slice-stream [![Build Status](https://travis-ci.org/EvanOxfeld/slice-stream.png)](https://travis-ci.org/EvanOxfeld/slice-stream)\n============\n\nPipe data through a stream until some fixed length is reached, then callback.\n\n## Installation\n\n```bash\n$ npm install slice-stream\n```\n\n## Quick Example\n\n### End stream once a fixed length has been reached\n\n```javascript\nvar SliceStream = require('../');\nvar streamBuffers = require(\"stream-buffers\");\n\nvar ss = new SliceStream({ length: 5}, function (buf, sliceEnd, extra) {\n  if (!sliceEnd) {\n    return this.push(buf);\n  }\n  this.push(buf);\n  return this.push(null); //signal end of data\n});\n\nvar sourceStream = new streamBuffers.ReadableStreamBuffer();\nsourceStream.put(\"Hello World\");\nvar writableStream = new streamBuffers.WritableStreamBuffer();\n\nsourceStream\n  .pipe(ss)\n  .pipe(writableStream)\n  .once('close', function () {\n    var str = writableStream.getContentsAsString('utf8');\n    console.log('First 5 bytes piped:', \"'\" + str + \"'\");\n    sourceStream.destroy();\n  });\n\n//Output\n//Piped data before pattern occurs: 'Hello'\n```\n\n## License\n\nMIT","publish_time":1363329077030,"_cnpm_publish_time":1363329077030,"dist-tags":{"latest":"1.0.0"}}