{"dist":{"shasum":"99bb9be862cf8f3e810c909633c6b4ffc96a6426","tarball":"https://registry.npmjs.org/match-stream/-/match-stream-0.0.0.tgz","integrity":"sha512-oqTIZf3ls1Z10EtS2Y1b+TwbSX2jRi7idWIb4IS0gCJsikvjzJwiCEFH80hKu9e9VlMxB93/bnv7ygx+aiRq7w==","signatures":[{"sig":"MEQCIBKmSLqqUw6QpiptZ0hCSvWA7aQeqIYQXaGgKaXCzV4PAiBc4xLdqoCEQyyFac+ZV7cjMFFQveNV1SunwYE/bZ4UnA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"match.js","name":"match-stream","_from":".","author":{"name":"Evan Oxfeld","email":"eoxfeld@gmail.com"},"readme":"match-stream [![Build Status](https://travis-ci.org/EvanOxfeld/match-stream.png)](https://travis-ci.org/EvanOxfeld/match-stream)\n============\n\nSupply a function to handle pattern matches within a NodeJS stream.\n\n## Installation\n\n```bash\n$ npm install match-stream\n```\n\n## Quick Example\n\n```javascript\nvar MatchStream = require('match-stream');\nvar streamBuffers = require(\"stream-buffers\");\n\nvar ms = new MatchStream({ pattern: 'World'}, function (buf, matched, extra) {\n  if (!matched) {\n    return this.push(buf);\n  }\n  this.push(buf);\n  return this.push(null); //end the stream\n});\n\nvar sourceStream = new streamBuffers.ReadableStreamBuffer();\nsourceStream.put(\"Hello World\");\nvar writableStream = new streamBuffers.WritableStreamBuffer();\n\nsourceStream\n  .pipe(ms)\n  .pipe(writableStream)\n  .once('close', function () {\n    var str = writableStream.getContentsAsString('utf8');\n    console.log('Piped data before pattern occurs:', \"'\" + str + \"'\");\n    sourceStream.destroy();\n  });\n\n//Output\n//Piped data before pattern occurs: 'Hello '\n```\n\n## License\n\nMIT\n\n## Acknowledgements\n\nSpecial thanks to @wanderview for assisting with the API.\n\n","gitHead":"665dabbb0a3593310012eb041fc07395db632a20","license":"MIT","scripts":{"test":"./node_modules/.bin/tap ./test/*.js"},"_npmUser":{"name":"evanoxfeld","email":"eoxfeld@gmail.com"},"keywords":["match","stream","split"],"repository":{"url":"https://github.com/EvanOxfeld/match-stream.git","type":"git"},"_npmVersion":"1.2.14","description":"Match a pattern within a stream","directories":{"test":"test","example":"examples"},"maintainers":[{"name":"evanoxfeld","email":"eoxfeld@gmail.com"}],"dependencies":{"buffers":"~0.1.1","readable-stream":"~1.0.0"},"readmeFilename":"README.md","devDependencies":{"tap":"~0.4.0","stream-buffers":"~0.2.4"},"_id":"match-stream@0.0.0","version":"0.0.0"}