npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

js-query-client-utils

v0.3.0

Published

A set of client utility classes that offer query parameter building with pagination, filtering and sorting

Readme

js-query-api-utils

This library provides a utility builder class '/lib/ClientQuery.js' for building api query parameters containing pagination, filtering and sorting, to be used to call APIs that the 'java-query-api-utils' project. All of the key field names and operators can be found in '/lib/ApiQueryParamaters.js'.

Pagination

Pagination can be implemented using the .addPaginationParameters(size, page) function passing parameters:

  • 'size' - defines the maximum number of records to return.
  • 'page' - defines which page of results to return as an offset based on page. Both values should be a positive integer, greater than zero.
  e.g.  new Builder().addPaginationParameters(1, 25).build();

  		/find-users?page=1&size=25

Sorting

Sorting is implemented using the .addSortingParameters(field, order) function taking parameters:

  • 'field' - the name of the field to be sorted.
  • 'order' - the direction of sort, which can be one of two values: -- 'asc' - defines ascending order. -- 'desc' - defines descending order.
 e.g.  new Builder().addSortingParameters("firstName", spec.SORTING_ASCENDING_PARAMETER).build();

 		/find-users?sort=firstName:asc

This get mapped to a ORDER BY clause constructed using JOOQs .orderBy method

Filtering

Filtering can be implemented using the .addFilterParameters(filed, value, operator) function taking paramaters:

  • 'field' - the name of the field to be filtered
  • 'value' - the value that you want to compare
  • 'operator' - the operator to be used for field comparison: -- 'eq' - Equal (used by default) -- 'neq' - Not equal -- 'lk' - Like -- 'gt' - Greater than -- 'gte' - Greater than or equal -- 'lt' - Less than -- 'lte' - Less than or equal
  e.g. new Builder().addFilterParameters("fistName", "Daniel", spec.FILTERING_EQUAL_OPERATOR).build();

  		/find-users?fullName=Daniel:eq
```