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/sitemap-client

v1.0.1

Published

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

Downloads

359

Readme

@thejob/sitemap-client

Typed client for thejob-sitemap-service: the URL enumeration behind the sitemap*.xml routes.

import { SitemapClient } from '@thejob/sitemap-client';

const sitemap = new SitemapClient({ baseUrl: process.env.SITEMAP_SERVICE_URL! });

Auth

None. Every route on this service is public, because crawlers and SSR sitemap routes are the callers. apiKey and token are accepted so the constructor matches the other clients, and for callers sitting behind a gateway that does require a header.

The API

| method | endpoint | |---|---| | countUrls(type) | GET /sitemap/count | | listUrls(type, query?) | GET /sitemap/urls | | health() | GET /health |

type is one of job, company, institute, group (SITEMAP_TYPES). An unknown type throws in-process rather than reaching the service: it would 400 there, and a caller looping over types would log it and still emit a sitemap silently missing a whole content class.

Walking a type

Prefer the cursor, not page. Offset paging re-scans and re-skips on every call, so enumerating hundreds of thousands of jobs gets slower the further it goes, and a document inserted mid-walk shifts the offsets and can duplicate or skip a row.

let cursor: string | undefined;
do {
  const { results, nextCursor } = await sitemap.listUrls('job', { limit: 1000, cursor });
  for (const entry of results) emit(entry);
  cursor = nextCursor ?? undefined;
} while (cursor);

nextCursor comes back null on the last page, which is the only reliable stop signal.

Two things that bite

  • limit is clamped service-side to 1..5000. Asking for more is not an error and does not return more, so code that assumes its own limit was honoured will under-enumerate. Read results.length.
  • updatedAt / createdAt are epoch milliseconds, and either can be absent. A <lastmod> builder has to handle undefined rather than formatting NaN.

Counts are filtered, not collection sizes

countUrls counts the same filter listUrls enumerates, so the two agree. Each type carries its own crawlability rules: jobs are published and from roughly the last three months, pages are published, groups are active + public + discoverable.

Development

pnpm build      # tsc -p tsconfig.json
pnpm test       # vitest run

The test suite reads the service's own route files and asserts this client has a method for every endpoint they register, so an endpoint added without a client method fails here.