1.5.1 • Published 3 years ago
fast-data-engine v1.5.1
Fast Data Engine is a blazing fast filtering engine.
Installation
yarn add fast-data-engineor
npm install fast-data-engine --saveSample 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:dataRun benchmarks
yarn build:benchmarks && node -e 'require("./build/benchmarks/benchmark-runner.min.js")'Start documentation site locally
docsify serve docsBenchmarking
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.4Then 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