{"_id":"filtr","_rev":"4121273","name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","dist-tags":{"latest":"0.3.0"},"maintainers":[{"name":"jakeluer","email":""}],"time":{"modified":"2026-02-13T22:15:13.000Z","created":"2012-01-28T05:47:15.712Z","0.3.0":"2012-06-19T01:10:13.521Z","0.2.4":"2012-03-10T01:06:53.367Z","0.2.3":"2012-03-09T01:56:07.210Z","0.2.2":"2012-03-09T00:13:03.899Z","0.2.1":"2012-02-26T03:09:47.619Z","0.2.0":"2012-02-20T21:03:03.589Z","0.1.3":"2012-02-17T21:49:19.603Z","0.1.2":"2012-01-28T22:32:06.826Z","0.1.1":"2012-01-28T14:24:10.410Z","0.1.0":"2012-01-28T05:47:15.712Z"},"users":{},"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"repository":{"type":"git","url":"git://github.com/logicalparadox/filtr.git"},"versions":{"0.3.0":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.3.0","repository":{"type":"git","url":"git://github.com/logicalparadox/filtr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.3.0","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.6.19","_defaultsLoaded":true,"dist":{"shasum":"957f8382e72a9efd97502150aa8cc6f488f9c62c","size":13225,"noattachment":false,"key":"/filtr/-/filtr-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.3.0.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1340068213521,"_hasShrinkwrap":false,"_cnpm_publish_time":1340068213521,"_cnpmcore_publish_time":"2021-12-16T23:29:59.345Z"},"0.2.4":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.2.4","repository":{"type":"git","url":"git://github.com/logicalparadox/filtr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.2.4","_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"b6625f400cc1510a06e01771b221db59fac4dd43","size":13221,"noattachment":false,"key":"/filtr/-/filtr-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.2.4.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1331341613367,"_hasShrinkwrap":false,"_cnpm_publish_time":1331341613367,"_cnpmcore_publish_time":"2021-12-16T23:29:59.564Z"},"0.2.3":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.2.3","repository":{"type":"git","url":"git://github.com/logicalparadox/filtr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.2.3","_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"d777dc2716a62179d2d879315da53e670170df4c","size":13015,"noattachment":false,"key":"/filtr/-/filtr-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.2.3.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1331258167210,"_hasShrinkwrap":false,"_cnpm_publish_time":1331258167210,"_cnpmcore_publish_time":"2021-12-16T23:29:59.951Z"},"0.2.2":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.2.2","repository":{"type":"git","url":"git://github.com/logicalparadox/filtr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.2.2","_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"f36514a4b9488d736b1089aee05a730af86f0a19","size":34071,"noattachment":false,"key":"/filtr/-/filtr-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.2.2.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1331251983899,"_hasShrinkwrap":false,"_cnpm_publish_time":1331251983899,"_cnpmcore_publish_time":"2021-12-16T23:30:00.192Z"},"0.2.1":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.2.1","repository":{"type":"git","url":"git://github.com/logicalparadox/filtr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.2.1","_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"8f49e249365b35bcf2a456e19989fc9021ca90ac","size":12675,"noattachment":false,"key":"/filtr/-/filtr-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.2.1.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1330225787619,"_hasShrinkwrap":false,"_cnpm_publish_time":1330225787619,"_cnpmcore_publish_time":"2021-12-16T23:30:00.384Z"},"0.2.0":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.2.0","repository":{"type":"git","url":"git://github.com/logicalparadox/filtr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.2.0","_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"bde9c0bfd3bd5a6940d591464395a4ce696bee5c","size":12509,"noattachment":false,"key":"/filtr/-/filtr-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.2.0.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1329771783589,"_hasShrinkwrap":false,"_cnpm_publish_time":1329771783589,"_cnpmcore_publish_time":"2021-12-16T23:30:00.587Z"},"0.1.3":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.1.3","repository":{"type":"git","url":"git://github.com/logicalparadox/fltr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.1.3","_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"e157729595131502552c9d3c94ab91e87e8dce6a","size":11910,"noattachment":false,"key":"/filtr/-/filtr-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.1.3.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1329515359603,"_hasShrinkwrap":false,"_cnpm_publish_time":1329515359603,"_cnpmcore_publish_time":"2021-12-16T23:30:00.811Z"},"0.1.2":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.1.2","repository":{"type":"git","url":"git://github.com/logicalparadox/fltr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.1.2","_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"5834b7fcd20b1550cd4091793572912205c01e39","size":11632,"noattachment":false,"key":"/filtr/-/filtr-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.1.2.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1327789926826,"_hasShrinkwrap":false,"_cnpm_publish_time":1327789926826,"_cnpmcore_publish_time":"2021-12-16T23:30:01.011Z"},"0.1.1":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.1.1","repository":{"type":"git","url":"git://github.com/logicalparadox/fltr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.1.1","_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"4d2eb9eae9e4fe265eb6cec1c2c379280c22bda8","size":11606,"noattachment":false,"key":"/filtr/-/filtr-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.1.1.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1327760650410,"_hasShrinkwrap":false,"_cnpm_publish_time":1327760650410,"_cnpmcore_publish_time":"2021-12-16T23:30:01.595Z"},"0.1.0":{"author":{"name":"Jake Luer","email":"jake@alogicalparadox.com"},"name":"filtr","description":"Array filtering for node.js and the browser inspired by MongoDB.","version":"0.1.0","repository":{"type":"git","url":"git://github.com/logicalparadox/fltr.git"},"main":"./index","scripts":{"test":"make test"},"engines":{"node":">=0.4.8"},"dependencies":{},"devDependencies":{"mocha":"*","chai":"*","folio":"0.2.x"},"optionalDependencies":{},"_npmUser":{"name":"jakeluer","email":"jake.luer@incatern.com"},"_id":"filtr@0.1.0","_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"87d67cc0f05e5719283aec44a5227807ae4e92f8","size":11541,"noattachment":false,"key":"/filtr/-/filtr-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/filtr/download/filtr-0.1.0.tgz"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1327729635712,"_hasShrinkwrap":false,"_cnpm_publish_time":1327729635712,"_cnpmcore_publish_time":"2021-12-16T23:30:01.857Z"}},"readme":"# Filtr [![Build Status](https://secure.travis-ci.org/logicalparadox/filtr.png)](http://travis-ci.org/logicalparadox/filtr)\n\nFilter javascript arrays using a MongoDB style syntax and is available for node.js\nand the browser. It was originally written as an internal component for [Seed](https://github.com/qualiancy/seed),\nbut it had no other dependancies and seemed fit for use in the browser.\n\n## Installation\n\n### Node.js\n\nFiltr is available on npm.\n\n    npm install filtr\n\n### Browser\n\nA browser build is available in the repository's `dist` folder.\nDownload the package and include either the normal or minimized build in your HTML header.\n\n    <script src=\"filtr.js\" type=\"text/javascript\"></script>\n    <script src=\"filtr.min.js\" type=\"text.javascript\"></script>\n\nThe browser build is fully AMD and CommonJS compatible and should work on all browser.\n\n## Features\n\nFiltr is still in early development so expect this list to grow.\n\n##### Expansive Query Language\n\n* Comparators: `$gt`, `$gte`, `$lt`, `$lte`, `$all`, `$exists`, `$mod`, `$eq`, `$ne`, `$in`, `$nin`, `$size`\n* Traversables: `$or`, `$nor`, `$and`\n\n##### Data Helpers\n\n* `filtr.getPathValue` returns the nested value in an object given a string path\n* `filtr.comparators` are available directly for quick value testing\n\n### Usage\n\n```js\nvar query = filtr({ $gt: 15, $lt: 25 })\n  , results = query.test([ 5, 10, 17, 19, 25 ]);\n// results == [ 17, 19 ];\n```\n\n#### Test options provide different output \n\nTesting also supports a number of options passed in as the second argument.\n\n* *spec*: output modifer\n  * _subset_: (default) return an array containing a subset of matched items\n  * _boolean_: return an array of the original length with each item being a boolean when object passed or failed.\n  * _index_: return an array of numbers matching the index of passed object in the original array\n* *type*: input modifier\n  * _set_: (default) assert that the data provided is an array. test each item.\n  * _single_: assert that the data provided is a single item. return boolean.\n\nUsing the `spec` output modifier is an easy way to handle post processing of result sets\nwithout having to match up a subset.\n\n```js\nvar query = filtr({ $gt: 15, $lt: 25 })\n  , results = query.test([ 5, 10, 17, 19, 25 ], { spec: 'boolean' });\n// results == [ false, false, true, true, false ];\n```\n\n#### Using paths for deep matching\n\nFiltr also supports using paths for deep matching within a javascript object. Given the \nfollowing items, and sample queries.\n\n```js\nvar dataComplex = [\n    { a: { b: 100 }\n    , c: 'testC'\n    , d: \n      [ { e: 'world' } ] \n    }\n  , { a: { b: 50 }\n    , c: 'testC'\n    , d: \n      [ { e: 'universe' }\n      , { e: 'galaxy' } ]\n    }\n];\n\nvar query1 = filtr({ 'a.b': { $gt: 75, $lt: 125 } });\n  , query2 = filtr({ 'a.b': { $gt: 25, $lt: 75 }, 'd[0].e': { $eq: 'universe' } });\n\nvar res1 = query1.test(dataComplex)  // result would have the first item\n  , res2 = query1.test(dataComplex); // result would have the second item \n```\n\nA helper is also available that returns the value in a nested object given a string path.\n\n```js\nvar hello = filtr.getPathValue('d[0].e', dataComplex[1]);\n// hello == 'universe'\n```\n\n## Where to Get Help\n\nPlease post issues to [GitHub Issues](https://github.com/logicalparadox/filtr/issues).\n\n## Tests\n\nTests are written in the BDD styles for the [Mocha]() test runner using the\n`should` assertion interface from [Chai](http://chaijs.com). Running tests is simple:\n\n    make test\n\nA browser suite is also available at `test/browser/index.js`. The same test definitions are \nused in both contexts.\n\n### Contributing\n\nInterested in contributing? Fork to get started. Contact [@logicalparadox](http://github.com/logicalparadox) \nif you are interested in being regular contributor.\n\n#### Contibutors \n\n* Jake Luer ([Github: @logicalparadox](http://github.com/logicalparadox)) ([Twitter: @jakeluer](http://twitter.com/jakeluer)) ([Website](http://alogicalparadox.com))\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011-2012 Jake Luer <jake@alogicalparadox.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_attachments":{}}