
New JavaScript library for high-performance filtering - stevendesu
I just created a new open source library to simplify my job and realized it might be incredibly useful to other people, so I wanted to advertise it a bit and see if there was any interest.<p>https:&#x2F;&#x2F;github.com&#x2F;stevendesu&#x2F;jsindex<p>The premise is this:<p>Given a collection in JavaScript (an array of objects, each of which has the same keys) this library will build a simple index - pre-filtering all records by their key values.<p>This enables:<p>1. Constant-time searching for records with a certain collection of values -- down from the O(n) solution that is Array.prototype.filter()
 2. Linear-time joining (left, right, inner, and outer join) of collections -- down from the O(n^2) solution of iterating over one array and using Array.prototype.filter() on the other<p>The library isn&#x27;t 100% finished, but I&#x27;ll keep working on it during my spare time. I&#x27;m also open to any suggestions or contributions. I was just really proud of it and wanted to see if anyone could use what I had built.<p>I plan to publish the library to NPM shortly (maybe tonight). I&#x27;ve just been too busy and kind of wanted to finish up all of the array function overrides first. Currently I&#x27;ve done the overrides for Array.push and Array.splice, but none of the others (Array.pop, Array.shift, Array.unshift, Array.concat)
======
stevendesu
[https://www.npmjs.com/package/jsindex](https://www.npmjs.com/package/jsindex)

I've published it on npmjs for anyone interested in trying it out. Note: Still
not 100% finished, so some features may not work.

