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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@thejob/pages-client

v1.0.1

Published

Typed TypeScript/JavaScript client for the thejob-page-service HTTP API.

Readme

@thejob/pages-client

Typed client for the thejob-page-service HTTP API. One method per endpoint.

import { PagesClient } from '@thejob/pages-client';

const pages = new PagesClient({
  baseUrl: process.env.PAGE_SERVICE_URL!,
  apiKey: process.env.PAGE_SERVICE_API_KEY, // backend-to-backend
});

const { results, total } = await pages.listPages({
  filter: { status: ['published'], type: ['company'] },
  limit: 6,
});

total is the count for the FILTER, not the number of rows returned, so a digest showing six cards under "1,198 companies" stays honest when limit changes.

The filter is nested, unlike jobs/users

This is the one place this client differs from @thejob/jobs-client and @thejob/users-client, and it is worth knowing before you hand-build a URL.

Those services read facets from the top level. page-service reads them from a filter[...] wrapper and splits each value on commas:

{ filter: { status: ['published', 'draft'] } }  ->  ?filter[status]=published,draft

The client owns that encoding. Two consequences you would otherwise hit:

  • Never send a nested array. filter[status][0]=published makes the service's greedy /^filter\[(.+)\]$/ read the field name as status][0, which used to mean 200 OK with zero rows and no error. The service now rejects it with a 400, and this client never produces it.
  • A filter value cannot contain a comma. The service splits unconditionally with no escape convention, so the client throws rather than let a value shred into terms that match nothing.

Facets

The vocabulary is PageFilterSchema in @thejob/schema — the same declaration page-service validates incoming keys against, so a facet cannot exist on one side and not the other. An unknown key is a 400 that lists what is supported.

Two traps the schema now closes, both verified against production data:

  • The field is type, not pageType. The enum constant is named PageType, which makes pageType the obvious guess; it exists on 0 of 1,449 documents.
  • categories is not filterable. PageSchema declares an array of strings, but pages store { id, name } objects, so a string comparison matches nothing. It is left out rather than shipped as a facet that silently returns nobody.

featuredMarkets is stored LOWERCASE (in, se, ww). Send it lowercase.

Auth

apiKey sends x-api-key (backend-to-backend). token sends Authorization: Bearer for routes behind requireUser / requireAdmin.

Any non-2xx throws PagesClientError, carrying status and the parsed body.