Json Function

It allows you to use methods such as where, limit, select, orderBy on JSON data.

Json-Function provides a lot of useful functions especially for your json data. It contains the methods you need too much to eliminate unnecessary code repetition.

You can use the Json-Function methods separately, but it is possible to use them all together. You can also chain it.

Github repository for your stars.

Usage

Install

$ npm install json-function

Import

import JsonFunction from 'json-function';

Usage

Example Data

const data = [
  {
    userId: 1,
    id: 1,
    title: "delectus aut autem",
    completed: false
  },
  {
    userId: 1,
    id: 2,
    title: "quis ut nam facilis et officia qui",
    completed: false
  },
  {
    userId: 1,
    id: 3,
    title: "fugiat veniam minus",
    completed: false
  },
  {
    userId: 1,
    id: 4,
    title: "et porro tempora",
    completed: true
  }
];

Chaining Syntax

Output

Basic Syntax

getQuery

Create a query and use it at any time.

setQuery

or

Last updated

Was this helpful?