Gaiety's visual representation as a fursona (an original furry fandom character) depicted as an animated gif falling downward with a controlled hand outstretched. Faer hair and tail waves in the wind while their floppy dog ears flop about as well. Fae are an anthromorphic canine like a german shepherd clothed like a human in a t-shirt and denim shorts. Art is by Lynte.

json-query-chain in Repos

Chain queries onto POJOs to return precise results.

Fork on Gitlab

npm version

100% test covered and developed with Test-Driven Development.

Usage

import Query from 'json-query-chain';

let myQ = new Query(someJsonData)
.search('isActiveUser', true)
.results;
javascript

Chainable Methods

Currently supports booleans and strings. (See #1 for Integer Support)

By Boolean
.search('isActiveUser', true)
javascript
By String
.search('name', 'steele')
javascript

Filter

Simpler version of search using a custom function in the chain.

.filter(a => a.age >= 21)
javascript
By Key
.filterBy('age', x => x >= 21)
javascript

Sort

By Boolean
.sort('isActiveUser', true)
javascript
By String
.sort('name')
javascript
By Number
.sort('netWorth')
javascript

Pagination

Page 1 with 5 results per page.

.paginate(1, 5)
javascript

Page 2 wtih default of 10 results per page.

.paginate(2)
javascript

Tests

npm test runs tests through Jest

ava@wroten.me

Wish to contact me about meetup or conference talks, work opportunities or otherwise? Reach out to me via email.

Resume

Work history, skills, volunteering and talks given all in a one page PDF.

Linkery

Like a Linktree! See where we can connect.

Git

Coding projects and such on a self hosted Forgejo instance.