Fast Data Engine is a blazing fast filtering engine.
Fast, simple, tiny, extensible, intuitive, documented, fully tested, magical.
yarn add fast-data-engine
or
npm install fast-data-engine --save
import { FastDataEngine } from 'fast-data-engine';
// the data you want to filter, group, etc
const data = [
{ firstName: 'Mary', age: 10 },
{ firstName: 'John', age: 20 },
{ firstName: 'John', age: 30 },
];
// filter by first name
const condition = {
and: [
{equals: {field: 'firstName', value: 'John'}},
{greaterThan: {field: 'age', value: 25}}
]
};
const { result } = FastDataEngine.filter(data, condition);
console.log(result);
// prints:
// [{ firstName: 'John', age: 30 }]
See the complete documentation here.
Import the FastDataEngine
service to access the API.
Provide your data in json
format, and you're all set.
Now call the filter()
function to get it filtered.
Generate test data
yarn benchmark:generate:data
Run benchmarks
yarn build:benchmarks && node -e 'require("./build/benchmarks/benchmark-runner.min.js")'
Start documentation site locally
docsify serve docs
To add a new version to the set of benchmarks, create and push a new git tag:
git tag 1.0.4
git push origin 1.0.4
Then add the new tag to the list of benchmark versions inside the run_benchmarks.sh
file:
#!/bin/bash
BENCHMARK_VERSIONS="0.0.1-alpha-1 0.0.1-alpha-2 1.0.4"
Contributions are very welcome!
We follow the "fork-and-pull" Git workflow. See the details here.
MIT
Created by Eduardo Born
with ❤ and coffee