Nybble Processing Mainframe
Wondering what’s next for npm?Check out our public roadmap! »

data-engine

3.1.1 • Public • Published

DATA-ENGINE

Simple data engine, to provide sort and filter. It can work with custom dataset.

Installation

npm install --save data-engine

Example Usage

import DataEngine, { Filter, Sort, FilterValue } from 'data-engine';
 
var Filter = require('data-engine');

Constructor

    const engine = new DataEngine();
    const engine2 = new DataEngine({
        data, primaryKey, sortFunction, direction,
    });

Data

    engine.setData(data);
    engine.Data = data;
    const data = engine.Data;
    const data = engine.getData();

Filters

    const filteredData = engine.updateFilters(filter, filter2, filter3);
    const filteredData = engine.removeFilters(filter, filter2, filter3);
    const filteredData = engine.addFilter(name, value, type);
    const filteredData = engine.clearFilters();

Sort

    const sorted = engine.sortBy('Column name');
    const sorted = engine.setSortFunction((a, b) => (> b? 1 : -1));
    const sorted = engine.setPrimaryKey('Column name');
    const sorted = engine.removePrimaryKey();
    const sorted = engine.setDefaultSort();

Install

npm i data-engine

DownloadsWeekly Downloads

7

Version

3.1.1

License

MIT

Unpacked Size

57.3 kB

Total Files

8

Last publish

Collaborators

  • avatar