json-object-query

1.1.2 • Public • Published

JSON Query

Simple JSON property finder with ORM-like syntax, only for static site / simple website with small data. We not recommend for JSON file more than 1MB or recursively JSON with 5 children or more.

Usage

Install it using yarn add json-object-query or npm install json-object-query.

And then, follow this below example.

import Query from 'json-object-query'

const query = new Query('json string')
const result = query
  .select('id, title')
  .sort('id', 'desc')
  .where('id', 10)
  .limit(30)
  .get()

console.log(result)

// [{ title: ..., description: ... }, ...]

API Usage

Method Description Priorty Default
select Select a fields that will you use 1 All
where - - -
limit - - -
sort - - -
findOneBy - - -
whereLike - - -
whereBetween - - -
get - - -

Source File

Thanks to JSON Placeholder for free JSON data that we use for example usage on this library.

License

This project under MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i json-object-query

Weekly Downloads

4

Version

1.1.2

License

MIT

Unpacked Size

8.55 kB

Total Files

7

Last publish

Collaborators

  • muhibbudins