npm.io
0.0.5 • Published 4 years ago

custom-sorts

Licence
MIT
Version
0.0.5
Deps
0
Size
3 kB
Vulns
0
Weekly
0

custom-sorts

This library is custom sort utils.

Installation

npm install custom-sorts

or

yarn add custom-sorts

Usage

This is all you need to get started:

const customSort = require('custom-sorts');
customSort.neSort([{ a: 10 }, { a: 5 }, { a: 20 }, { a: 8 }, {}], 'a', true);
// [ { a: 5 }, { a: 8 }, { a: 10 }, { a: 20 }, {} ]
or es6
import { neSort } from 'custom-sorts';
neSort([{ a: 10 }, { a: 5 }, { a: 20 }, { a: 8 }, {}], 'a', false);
// [ { a: 20 }, { a: 10 }, { a: 8 }, { a: 5 }, {} ]

License

MIT