{"_id":"match-stream","_rev":"53730","name":"match-stream","description":"Match a pattern within a stream","dist-tags":{"latest":"0.0.2"},"maintainers":[{"name":"evanoxfeld","email":"eoxfeld@gmail.com"}],"time":{"modified":"2021-06-03T10:16:23.000Z","created":"2013-03-10T06:09:11.420Z","0.0.2":"2013-04-04T06:17:25.669Z","0.0.1":"2013-03-10T21:36:32.232Z","0.0.0":"2013-03-10T06:09:11.420Z"},"users":{"leix3041":true},"author":{"name":"Evan Oxfeld","email":"eoxfeld@gmail.com"},"repository":{"type":"git","url":"https://github.com/EvanOxfeld/match-stream.git"},"versions":{"0.0.2":{"name":"match-stream","version":"0.0.2","description":"Match a pattern within a stream","main":"match.js","directories":{"example":"examples","test":"test"},"dependencies":{"buffers":"~0.1.1","readable-stream":"~1.0.0"},"devDependencies":{"tap":"~0.4.0","stream-buffers":"~0.2.4"},"scripts":{"test":"./node_modules/.bin/tap ./test/*.js"},"repository":{"type":"git","url":"https://github.com/EvanOxfeld/match-stream.git"},"keywords":["match","stream","split"],"author":{"name":"Evan Oxfeld","email":"eoxfeld@gmail.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"665dabbb0a3593310012eb041fc07395db632a20","_id":"match-stream@0.0.2","dist":{"shasum":"99eb050093b34dffade421b9ac0b410a9cfa17cf","size":8659,"noattachment":false,"key":"/match-stream/-/match-stream-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/match-stream/download/match-stream-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"evanoxfeld","email":"eoxfeld@gmail.com"},"maintainers":[{"name":"evanoxfeld","email":"eoxfeld@gmail.com"}],"publish_time":1365056245669,"_hasShrinkwrap":false,"_cnpm_publish_time":1365056245669},"0.0.1":{"name":"match-stream","version":"0.0.1","description":"Match a pattern within a stream","main":"match.js","directories":{"example":"examples","test":"test"},"dependencies":{"buffers":"~0.1.1","readable-stream":"~1.0.0"},"devDependencies":{"tap":"~0.4.0","stream-buffers":"~0.2.4"},"scripts":{"test":"./node_modules/.bin/tap ./test/*.js"},"repository":{"type":"git","url":"https://github.com/EvanOxfeld/match-stream.git"},"keywords":["match","stream","split"],"author":{"name":"Evan Oxfeld","email":"eoxfeld@gmail.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"665dabbb0a3593310012eb041fc07395db632a20","_id":"match-stream@0.0.1","dist":{"shasum":"d773ce718b1ffa43049137988f2516f0047e4b9c","size":8570,"noattachment":false,"key":"/match-stream/-/match-stream-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/match-stream/download/match-stream-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"evanoxfeld","email":"eoxfeld@gmail.com"},"maintainers":[{"name":"evanoxfeld","email":"eoxfeld@gmail.com"}],"publish_time":1362951392232,"_hasShrinkwrap":false,"_cnpm_publish_time":1362951392232},"0.0.0":{"name":"match-stream","version":"0.0.0","description":"Match a pattern within a stream","main":"match.js","directories":{"example":"examples","test":"test"},"dependencies":{"buffers":"~0.1.1","readable-stream":"~1.0.0"},"devDependencies":{"tap":"~0.4.0","stream-buffers":"~0.2.4"},"scripts":{"test":"./node_modules/.bin/tap ./test/*.js"},"repository":{"type":"git","url":"https://github.com/EvanOxfeld/match-stream.git"},"keywords":["match","stream","split"],"author":{"name":"Evan Oxfeld","email":"eoxfeld@gmail.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"665dabbb0a3593310012eb041fc07395db632a20","_id":"match-stream@0.0.0","dist":{"shasum":"99bb9be862cf8f3e810c909633c6b4ffc96a6426","size":2365,"noattachment":false,"key":"/match-stream/-/match-stream-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/match-stream/download/match-stream-0.0.0.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"evanoxfeld","email":"eoxfeld@gmail.com"},"maintainers":[{"name":"evanoxfeld","email":"eoxfeld@gmail.com"}],"publish_time":1362895751420,"_hasShrinkwrap":false,"_cnpm_publish_time":1362895751420}},"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","_attachments":{},"readmeFilename":"README.md","license":"MIT"}