{"_id":"streamsearch","_rev":"2007708","name":"streamsearch","description":"Streaming Boyer-Moore-Horspool searching for node.js","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"time":{"modified":"2021-12-19T19:16:16.000Z","created":"2012-12-11T17:37:59.897Z","1.1.0":"2021-12-19T19:12:20.627Z","1.0.0":"2021-12-06T04:34:39.895Z","0.1.2":"2013-04-14T17:49:09.358Z","0.1.1":"2013-04-14T01:01:21.348Z","0.1.0":"2013-03-04T23:21:08.956Z","0.0.2":"2012-12-11T21:04:44.829Z","0.0.1":"2012-12-11T17:37:59.897Z"},"users":{"sessionbean":true,"nachbar90":true,"mojaray2k":true,"reinoudk":true},"author":{"name":"Brian White","email":"mscdex@mscdex.net"},"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/streamsearch.git"},"versions":{"1.1.0":{"name":"streamsearch","version":"1.1.0","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Streaming Boyer-Moore-Horspool searching for node.js","main":"./lib/sbmh.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.1.0","eslint":"^7.32.0"},"scripts":{"test":"node test/test.js","lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib test","lint:fix":"npm run lint -- --fix"},"keywords":["stream","horspool","boyer-moore-horspool","boyer-moore","search"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/streamsearch/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/streamsearch.git"},"_resolved":"","_integrity":"","_from":"https://github.com/mscdex/streamsearch/tarball/v1.1.0","bugs":{"url":"https://github.com/mscdex/streamsearch/issues"},"homepage":"https://github.com/mscdex/streamsearch#readme","_id":"streamsearch@1.1.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"shasum":"404dd1e2247ca94af554e841a8ef0eaa238da764","size":5370,"noattachment":false,"key":"/streamsearch/-/streamsearch-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/streamsearch/download/streamsearch-1.1.0.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/streamsearch_1.1.0_1639941140459_0.2920136163263838"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-19T19:12:37.080Z","publish_time":1639941140627,"_cnpm_publish_time":1639941140627},"1.0.0":{"name":"streamsearch","version":"1.0.0","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Streaming Boyer-Moore-Horspool searching for node.js","main":"./lib/sbmh.js","engines":{"node":">=10.0.0"},"devDependencies":{"@mscdex/eslint-config":"^1.0.0","eslint":"^7.0.0"},"scripts":{"test":"node test/test.js","lint":"eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib test","lint:fix":"npm run lint -- --fix"},"keywords":["stream","horspool","boyer-moore-horspool","boyer-moore","search"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/streamsearch/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/streamsearch.git"},"_resolved":"","_integrity":"","_from":"https://github.com/mscdex/streamsearch/tarball/v1.0.0","bugs":{"url":"https://github.com/mscdex/streamsearch/issues"},"homepage":"https://github.com/mscdex/streamsearch#readme","_id":"streamsearch@1.0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"shasum":"2efd0aab4bb054b3490d06633e9cff92191e54ec","size":5156,"noattachment":false,"key":"/streamsearch/-/streamsearch-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/streamsearch/download/streamsearch-1.0.0.tgz"},"_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"directories":{},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/streamsearch_1.0.0_1638765279733_0.060673163816512776"},"_hasShrinkwrap":false,"publish_time":1638765279895,"_cnpm_publish_time":1638765279895},"0.1.2":{"name":"streamsearch","version":"0.1.2","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Streaming Boyer-Moore-Horspool searching for node.js","main":"./lib/sbmh","engines":{"node":">=0.8.0"},"keywords":["stream","horspool","boyer-moore-horspool","boyer-moore","search"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/streamsearch/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/streamsearch.git"},"readmeFilename":"README.md","_id":"streamsearch@0.1.2","dist":{"shasum":"808b9d0e56fc273d809ba57338e929919a1a9f1a","size":3886,"noattachment":false,"key":"/streamsearch/-/streamsearch-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/streamsearch/download/streamsearch-0.1.2.tgz"},"_from":"https://github.com/mscdex/streamsearch/tarball/v0.1.2","_resolved":"https://github.com/mscdex/streamsearch/tarball/v0.1.2","scripts":{},"_npmVersion":"1.2.18","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"directories":{},"publish_time":1365961749358,"_cnpm_publish_time":1365961749358,"_hasShrinkwrap":false},"0.1.1":{"name":"streamsearch","version":"0.1.1","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Streaming Boyer-Moore-Horspool searching for node.js","main":"./sbmh","engines":{"node":">=0.8.0"},"keywords":["stream","horspool","boyer-moore-horspool","boyer-moore","search"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/streamsearch/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/streamsearch.git"},"readmeFilename":"README.md","_id":"streamsearch@0.1.1","dist":{"shasum":"b29160bf407ba701ae9326249cbb3245e46a37c1","size":3904,"noattachment":false,"key":"/streamsearch/-/streamsearch-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/streamsearch/download/streamsearch-0.1.1.tgz"},"_from":"https://github.com/mscdex/streamsearch/tarball/v0.1.1","_resolved":"https://github.com/mscdex/streamsearch/tarball/v0.1.1","scripts":{},"_npmVersion":"1.2.18","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"directories":{},"publish_time":1365901281348,"_cnpm_publish_time":1365901281348,"_hasShrinkwrap":false},"0.1.0":{"name":"streamsearch","version":"0.1.0","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Streaming Boyer-Moore-Horspool searching for node.js","main":"./sbmh","engines":{"node":">=0.8.0"},"keywords":["stream","horspool","boyer-moore-horspool","boyer-moore","search"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/streamsearch/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/streamsearch.git"},"readmeFilename":"README.md","_id":"streamsearch@0.1.0","dist":{"shasum":"2c106c4b8e869f9762bb0c362c5af1e8d3b4da74","size":3875,"noattachment":false,"key":"/streamsearch/-/streamsearch-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/streamsearch/download/streamsearch-0.1.0.tgz"},"_from":"https://github.com/mscdex/streamsearch/tarball/v0.1.0","_resolved":"https://github.com/mscdex/streamsearch/tarball/v0.1.0","scripts":{},"_npmVersion":"1.2.11","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"directories":{},"publish_time":1362439268956,"_cnpm_publish_time":1362439268956,"_hasShrinkwrap":false},"0.0.2":{"name":"streamsearch","version":"0.0.2","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Streaming Boyer-Moore-Horspool searching for node.js","main":"./sbmh","engines":{"node":">=0.8.0"},"keywords":["stream","horspool","boyer-moore-horspool","boyer-moore","search"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/streamsearch/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/streamsearch.git"},"readmeFilename":"README.md","_id":"streamsearch@0.0.2","dist":{"shasum":"0d446c92b56bad4aa96d588aeeb9d90e1c4af8be","size":3760,"noattachment":false,"key":"/streamsearch/-/streamsearch-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/streamsearch/download/streamsearch-0.0.2.tgz"},"scripts":{},"_npmVersion":"1.1.66","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"directories":{},"publish_time":1355259884829,"_cnpm_publish_time":1355259884829,"_hasShrinkwrap":false},"0.0.1":{"name":"streamsearch","version":"0.0.1","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Streaming Boyer-Moore-Horspool searching for node.js","main":"./sbmh","engines":{"node":">=0.8.0"},"keywords":["stream","horspool","boyer-moore-horspool","boyer-moore","search"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/streamsearch/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/streamsearch.git"},"readmeFilename":"README.md","_id":"streamsearch@0.0.1","dist":{"shasum":"5350ebc548378da45f3727aefebac3aec5dcc345","size":3860,"noattachment":false,"key":"/streamsearch/-/streamsearch-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/streamsearch/download/streamsearch-0.0.1.tgz"},"scripts":{},"_npmVersion":"1.1.66","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"directories":{},"publish_time":1355247479897,"_cnpm_publish_time":1355247479897,"_hasShrinkwrap":false}},"readme":"Description\n===========\n\nstreamsearch is a module for [node.js](http://nodejs.org/) that allows searching a stream using the Boyer-Moore-Horspool algorithm.\n\nThis module is based heavily on the Streaming Boyer-Moore-Horspool C++ implementation by Hongli Lai [here](https://github.com/FooBarWidget/boyer-moore-horspool).\n\n\nRequirements\n============\n\n* [node.js](http://nodejs.org/) -- v10.0.0 or newer\n\n\nInstallation\n============\n\n    npm install streamsearch\n\nExample\n=======\n\n```js\n  const { inspect } = require('util');\n\n  const StreamSearch = require('streamsearch');\n\n  const needle = Buffer.from('\\r\\n');\n  const ss = new StreamSearch(needle, (isMatch, data, start, end) => {\n    if (data)\n      console.log('data: ' + inspect(data.toString('latin1', start, end)));\n    if (isMatch)\n      console.log('match!');\n  });\n\n  const chunks = [\n    'foo',\n    ' bar',\n    '\\r',\n    '\\n',\n    'baz, hello\\r',\n    '\\n world.',\n    '\\r\\n Node.JS rules!!\\r\\n\\r\\n',\n  ];\n  for (const chunk of chunks)\n    ss.push(Buffer.from(chunk));\n\n  // output:\n  //\n  // data: 'foo'\n  // data: ' bar'\n  // match!\n  // data: 'baz, hello'\n  // match!\n  // data: ' world.'\n  // match!\n  // data: ' Node.JS rules!!'\n  // match!\n  // data: ''\n  // match!\n```\n\n\nAPI\n===\n\nProperties\n----------\n\n* **maxMatches** - < _integer_ > - The maximum number of matches. Defaults to `Infinity`.\n\n* **matches** - < _integer_ > - The current match count.\n\n\nFunctions\n---------\n\n* **(constructor)**(< _mixed_ >needle, < _function_ >callback) - Creates and returns a new instance for searching for a _Buffer_ or _string_ `needle`. `callback` is called any time there is non-matching data and/or there is a needle match. `callback` will be called with the following arguments:\n\n  1. `isMatch` - _boolean_ - Indicates whether a match has been found\n\n  2. `data` - _mixed_ - If set, this contains data that did not match the needle.\n\n  3. `start` - _integer_ - The index in `data` where the non-matching data begins (inclusive).\n\n  4. `end` - _integer_ - The index in `data` where the non-matching data ends (exclusive).\n\n* **push**(< _Buffer_ >chunk) - _integer_ - Processes `chunk`, searching for a match. The return value is the last processed index in `chunk` + 1.\n\n* **reset**() - _(void)_ - Resets internal state. Useful for when you wish to start searching a new/different stream for example.\n","_attachments":{},"homepage":"https://github.com/mscdex/streamsearch#readme","bugs":{"url":"https://github.com/mscdex/streamsearch/issues"}}