fast-data-engine
v1.5.1
Published
Fast Data Engine is a blazing fast data filtering engine.
Downloads
19
Maintainers
Readme
Fast Data Engine is a blazing fast filtering engine.
Installation
yarn add fast-data-engine
or
npm install fast-data-engine --save
Sample Usage
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.
In a Nutshell
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.
Dev
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
Benchmarking
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"
Contributing
Contributions are very welcome!
We follow the "fork-and-pull" Git workflow. See the details here.
License
MIT
Created by Eduardo Born
with ❤ and coffee