{"_id":"fuzzy","_rev":"256221","name":"fuzzy","description":"small, standalone fuzzy search / fuzzy filter. browser or node","dist-tags":{"latest":"0.1.3"},"maintainers":[{"name":"mattyork","email":"york.matt@gmail.com"}],"time":{"modified":"2021-06-03T16:25:20.000Z","created":"2012-07-26T03:39:15.836Z","0.1.3":"2016-10-01T20:36:13.723Z","0.1.2":"2016-09-25T20:13:57.710Z","0.1.1":"2015-09-19T21:05:47.183Z","0.1.0":"2012-07-26T03:39:15.836Z"},"users":{"fgribreau":true,"samuelg":true,"brandonb927":true,"jamestclark":true,"christhebaron":true,"mizdra":true,"bassettsj":true,"preco21":true,"pirijan":true,"acollins-ts":true,"mccoyjordan":true,"zillding":true,"vutran":true,"mikeljames":true,"monsterkodi":true,"whitelynx":true,"max_devjs":true,"alexcoady":true,"santi8ago8":true,"joaquin.briceno":true,"brunolm":true,"rocket0191":true,"usex":true,"keenwon":true,"justdomepaul":true,"daniel-zahariev":true,"suissa":true},"author":{"name":"Matt York","email":"york.matt@gmail.com","url":"mattyork.org"},"repository":{"type":"git","url":"git://github.com/mattyork/fuzzy.git"},"versions":{"0.1.3":{"name":"fuzzy","description":"small, standalone fuzzy search / fuzzy filter. browser or node","version":"0.1.3","homepage":"https://github.com/mattyork/fuzzy","author":{"name":"Matt York","email":"york.matt@gmail.com","url":"mattyork.org"},"repository":{"type":"git","url":"git://github.com/mattyork/fuzzy.git"},"bugs":{"url":"https://github.com/mattyork/fuzzy/issues"},"licenses":[{"type":"MIT","url":"https://github.com/mattyork/fuzzy/blob/master/LICENSE-MIT"}],"main":"lib/fuzzy","typings":"lib/fuzzy","engines":{"node":">= 0.6.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":">= 1.3.0","chai":">= 1.1.1","underscore":">= 1.3.3","uglify-js":">= 1.3.2","jshint":">= 0.7.1"},"keywords":["fuzzy","search","filter","sublime","sublime text"],"gitHead":"39e3f256ce44411bc20ee79bc6bbf616ac88d163","_id":"fuzzy@0.1.3","_shasum":"4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8","_from":".","_npmVersion":"3.5.2","_nodeVersion":"5.1.1","_npmUser":{"name":"mattyork","email":"york.matt@gmail.com"},"dist":{"shasum":"4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8","size":5517,"noattachment":false,"key":"/fuzzy/-/fuzzy-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/fuzzy/download/fuzzy-0.1.3.tgz"},"maintainers":[{"name":"mattyork","email":"york.matt@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/fuzzy-0.1.3.tgz_1475354173470_0.7299453085288405"},"directories":{},"publish_time":1475354173723,"_cnpm_publish_time":1475354173723,"_hasShrinkwrap":false},"0.1.2":{"name":"fuzzy","description":"small, standalone fuzzy search / fuzzy filter. browser or node","version":"0.1.2","homepage":"https://github.com/mattyork/fuzzy","author":{"name":"Matt York","email":"york.matt@gmail.com","url":"mattyork.org"},"repository":{"type":"git","url":"git://github.com/mattyork/fuzzy.git"},"bugs":{"url":"https://github.com/mattyork/fuzzy/issues"},"licenses":[{"type":"MIT","url":"https://github.com/mattyork/fuzzy/blob/master/LICENSE-MIT"}],"main":"lib/fuzzy","typings":"lib/fuzzy","engines":{"node":">= 0.6.0"},"scripts":{"test":"make test"},"devDependencies":{"mocha":">= 1.3.0","chai":">= 1.1.1","underscore":">= 1.3.3","uglify-js":">= 1.3.2","jshint":">= 0.7.1"},"keywords":["fuzzy","search","filter","sublime","sublime text"],"gitHead":"a66881f147b95f9c914fc8ef5229087dd844a738","_id":"fuzzy@0.1.2","_shasum":"08cdcab1207f559bb962cc80439402ead973a26d","_from":".","_npmVersion":"3.5.2","_nodeVersion":"5.1.1","_npmUser":{"name":"mattyork","email":"york.matt@gmail.com"},"dist":{"shasum":"08cdcab1207f559bb962cc80439402ead973a26d","size":5277,"noattachment":false,"key":"/fuzzy/-/fuzzy-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/fuzzy/download/fuzzy-0.1.2.tgz"},"maintainers":[{"name":"mattyork","email":"york.matt@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/fuzzy-0.1.2.tgz_1474834435230_0.21343168942257762"},"directories":{},"publish_time":1474834437710,"_cnpm_publish_time":1474834437710,"_hasShrinkwrap":false},"0.1.1":{"name":"fuzzy","description":"small, standalone fuzzy search / fuzzy filter. browser or node","version":"0.1.1","homepage":"https://github.com/mattyork/fuzzy","author":{"name":"Matt York","email":"york.matt@gmail.com","url":"mattyork.org"},"repository":{"type":"git","url":"git://github.com/mattyork/fuzzy.git"},"bugs":{"url":"https://github.com/mattyork/fuzzy/issues"},"licenses":[{"type":"MIT","url":"https://github.com/mattyork/fuzzy/blob/master/LICENSE-MIT"}],"main":"lib/fuzzy","engines":{"node":">= 0.6.0"},"scripts":{"test":"make test"},"devDependencies":{"mocha":">= 1.3.0","chai":">= 1.1.1","underscore":">= 1.3.3","uglify-js":">= 1.3.2","jshint":">= 0.7.1"},"keywords":["fuzzy","search","filter","sublime","sublime text"],"gitHead":"70698b03784b2f902e5ce61da1e6247d811854f2","_id":"fuzzy@0.1.1","_shasum":"be5aa14ad71989a1964e8e52097e1a6b96a16e1a","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.12.2","_npmUser":{"name":"mattyork","email":"york.matt@gmail.com"},"dist":{"shasum":"be5aa14ad71989a1964e8e52097e1a6b96a16e1a","size":4811,"noattachment":false,"key":"/fuzzy/-/fuzzy-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fuzzy/download/fuzzy-0.1.1.tgz"},"maintainers":[{"name":"mattyork","email":"york.matt@gmail.com"}],"directories":{},"publish_time":1442696747183,"_cnpm_publish_time":1442696747183,"_hasShrinkwrap":false},"0.1.0":{"name":"fuzzy","description":"small, standalone fuzzy search / fuzzy filter. browser or node","version":"0.1.0","homepage":"https://github.com/myork/fuzzy","author":{"name":"Matt York","email":"york.matt@gmail.com","url":"mattyork.org"},"repository":{"type":"git","url":"git://github.com/myork/fuzzy.git"},"bugs":{"url":"https://github.com/myork/fuzzy/issues"},"licenses":[{"type":"MIT","url":"https://github.com/myork/fuzzy/blob/master/LICENSE-MIT"}],"main":"lib/fuzzy","engines":{"node":">= 0.6.0"},"scripts":{"test":"make test"},"devDependencies":{"mocha":">= 1.3.0","chai":">= 1.1.1","underscore":">= 1.3.3","uglify-js":">= 1.3.2","jshint":">= 0.7.1"},"keywords":["fuzzy","search","filter"],"_id":"fuzzy@0.1.0","dist":{"shasum":"f9c8116df510969454ed9ab3824cdfb520eafc63","size":2290197,"noattachment":false,"key":"/fuzzy/-/fuzzy-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fuzzy/download/fuzzy-0.1.0.tgz"},"maintainers":[{"name":"mattyork","email":"york.matt@gmail.com"}],"directories":{},"publish_time":1343273955836,"_cnpm_publish_time":1343273955836,"_hasShrinkwrap":false}},"readme":"# fuzzy [![Build Status](https://img.shields.io/travis/mattyork/fuzzy/master.svg)](https://travis-ci.org/mattyork/fuzzy) [![npm version](https://badge.fury.io/js/fuzzy.svg)](https://badge.fury.io/js/fuzzy)\n\n1k standalone fuzzy search / fuzzy filter a la Sublime Text's command-p fuzzy file search. Works in both node and browser.\n\n[![Example](http://i.imgur.com/obzCQq7.gif)](http://htmlpreview.github.io/?https://github.com/mattyork/fuzzy/blob/master/examples/disney.html)\n\nTry it yourself: [Disney Character Search Example](http://htmlpreview.github.io/?https://github.com/mattyork/fuzzy/blob/master/examples/disney.html)\n\n## Get it\n\nNode:\n\n```bash\n$ npm install --save fuzzy\n$ node\n> var fuzzy = require('fuzzy');\n> console.log(fuzzy)\n{ test: [Function],\n  match: [Function],\n  filter: [Function] }\n```\n\nBrowser:\n\n```html\n<script src=\"/path/to/fuzzy.js\"></script>\n<script>\n  console.log(fuzzy);\n  // Object >\n  //   filter: function (pattern, arr, opts) {\n  //   match: function (pattern, string, opts) {\n  //   test: function (pattern, string) {\n</script>\n```\n\n## Use it\n\nPadawan: Simply filter an array of strings.\n\n```javascript\nvar list = ['baconing', 'narwhal', 'a mighty bear canoe'];\nvar results = fuzzy.filter('bcn', list)\nvar matches = results.map(function(el) { return el.string; });\nconsole.log(matches);\n// [ 'baconing', 'a mighty bear canoe' ]\n```\n\nJedi: Wrap matching characters in each string\n\n```javascript\nvar list = ['baconing', 'narwhal', 'a mighty bear canoe'];\nvar options = { pre: '<', post: '>' };\nvar results = fuzzy.filter('bcn', list, options)\nconsole.log(results);\n// [\n//   {string: '<b>a<c>o<n>ing'           , index: 0, score: 3, original: 'baconing'},\n//   {string: 'a mighty <b>ear <c>a<n>oe', index: 2, score: 3, original: 'a mighty bear canoe'}\n// ]\n```\n\nJedi Master: sometimes the array you give is not an array of strings. You can\npass in a function that creates the string to match against from each element\nin the given array\n\n```javascript\nvar list = [\n    {rompalu: 'baconing', zibbity: 'simba'}\n  , {rompalu: 'narwhal' , zibbity: 'mufasa'}\n  , {rompalu: 'a mighty bear canoe', zibbity: 'saddam hussein'}\n];\nvar options = {\n    pre: '<'\n  , post: '>'\n  , extract: function(el) { return el.rompalu; }\n};\nvar results = fuzzy.filter('bcn', list, options);\nvar matches = results.map(function(el) { return el.string; });\nconsole.log(matches);\n// [ '<b>a<c>o<n>ing', 'a mighty <b>ear <c>a<n>oe' ]\n```\n\n## Examples\nCheck out the html files in the [examples](https://github.com/mattyork/fuzzy/tree/master/examples) directory.\n\nTry the examples live: \n- [disney](http://htmlpreview.github.io/?https://github.com/mattyork/fuzzy/blob/master/examples/disney.html)\n- [wikipedia](http://htmlpreview.github.io/?https://github.com/mattyork/fuzzy/blob/master/examples/wikipedia.html)\n## Documentation\n[Code is well documented](https://github.com/mattyork/fuzzy/blob/master/lib/fuzzy.js) and the [unit tests](https://github.com/mattyork/fuzzy/blob/master/test/fuzzy.test.js) cover all functionality\n\n## Contributing\nFork the repo!\n\n    git clone <your_fork>\n    cd fuzzy\n    npm install\n    make\n\nAdd unit tests for any new or changed functionality. Lint, test, and minify using make, then shoot me a pull request.\n\n## Release History\nv0.1.0 - July 25, 2012\n\n* Initial Release\n\nv0.1.1 - September 19, 2015\n\n* Fix broken links in package.json\n* Fix examples\n\nv0.1.2 - September 25, 2016\n\n* Exact matches get the highest score. #15\n* Add TypeScript typings #21\n* Better error handling for invalid input #13\n* Smaller bower install footprint #22\n\nv0.1.3 - October 1, 2016\n\n* Fix blocking bug in React Native #27\n\n## License\nCopyright (c) 2015 Matt York\nLicensed under the MIT license.\n\n## TODO\n\n1. Search improvement: behave a bit more like sublime text by getting\n   the BEST match in a given string, not just the first. For example,\n   searching for 'bass' in 'bodacious bass' should match against 'bass',\n   but it currently matches like so: `<b>od<a>ciou<s> ba<s>s`. There is\n   a test already written, just need to implement it. Naive O(n^2) worst\n   case: find every match in the string, then select the highest scoring\n   match. Should benchmark this against current implementation once implemented\n   Also, \"reactive rice\" would be `<r><e>active r<i><c>e`\n2. Search feature: Work on multiple strings in a match. For example, be able\n   to match against 'stth' against an object { folder: 'stuff', file: 'thing' }\n3. Async batch updates so the UI doesn't block for huge sets. Or maybe Web Workers?\n4. Performance performance performance!\n","_attachments":{},"homepage":"https://github.com/mattyork/fuzzy","bugs":{"url":"https://github.com/mattyork/fuzzy/issues"}}