@pallab.gain/lazy-filter

1.0.4 • Public • Published

Lazy Filter

Build Status Coverage Status

Remove or filter out value, or list of values from JSON object lazily.

Install package

npm install @pallab.gain/lazy-filter

How to use the library

const user = {
  "firstName" :  "Pallab",
  "lastName" :  "Gain",
  "email" : "example@mail.com",
  "password": "my secrect password",
  "id": "my-secret-id"
}

Nodejs/react like example

// initialize
const {
  omit,
  pick
} = require('@pallab.gain/lazy-filter');

// user object filter
const filteredUser = omit(user, ["password","id","email"])
const filteredUser = pick(user, ["password","id","email"])

Browser example

// add the library in your html
<script src="/dist/lazyfilter.js"></script>

// user object filtering
const omitedUser = LazyFilter.omit(user, ["password","id","email"])
const pickedUser = LazyFilter.pick(user, ["password","id","email"])

Install devependecies and build library

  • Install dependencies

    npm install

  • Build non-minified version of the library

    npm run build-dev

  • Build library and use in production

    npm run build-prod

    You will find the library in dist folder

  • Update or generate api doc

    npm run generate-doc

  • Run tests

    npm run test

API Doc

Package Sidebar

Install

npm i @pallab.gain/lazy-filter

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

36.5 kB

Total Files

14

Last publish

Collaborators

  • pallab.gain