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/data-processor-client

v0.1.2

Published

Typed TypeScript/JavaScript client for the thejob-data-processor HTTP API.

Readme

@thejob/data-processor-client

Typed TypeScript/JavaScript client for the thejob-data-processor HTTP API. External systems use this instead of hand-building fetch requests.

The contract is small. A consumer does two things:

  1. Push data in with ingest(records, opts), optionally attaching a webhookConfig so each record's processed result is delivered to your URL.
  2. Pull as a backstop with pollProcessed() to catch up on anything a webhook missed.

You never name a pipeline or manage runs, you ingest records under a shared type and receive the processed result. The shared type/source/webhookConfig go once in opts (sent once on the wire, not repeated per record). The client owns the base URL, JSON plumbing, the request envelope, cursor paging, and typed errors.

Zero runtime dependencies. Uses the global fetch (Node 18+, Deno, browsers, edge).

Install

npm install @thejob/data-processor-client

Usage

import { DataProcessorClient, DataProcessorError } from '@thejob/data-processor-client';

const dp = new DataProcessorClient({ baseUrl: 'http://localhost:3000' });

// 1. Push data in. Records share type/source/webhook via opts (sent once). Attach
//    a webhookConfig to have each record's processed result POSTed to your URL
//    (signed when you set a secret, so you can verify it). A repeated dedupKey is
//    reported as a duplicate, not re-ingested.
const report = await dp.ingest(
  [
    { dedupKey: 'job-123', payload: { url: '...' } },
    { dedupKey: 'job-124', payload: { url: '...' } },
  ],
  {
    type: 'job',
    source: 'scraper',
    webhookConfig: { url: 'https://my-app.example/hooks/data-processor', secret: 'whsec_...' },
  },
);
console.log(report.accepted, report.duplicates, report.failed);

// 2. Pull backstop: if your webhook was down (or you attached none), catch up.
//    The cursor is threaded across pages; pass a saved cursor to resume.
for await (const page of dp.pollProcessed({ type: 'job' })) {
  for (const record of page.records) {
    handle(record.payload);
  }
}

// Errors are typed.
try {
  await dp.records.get('does-not-exist');
} catch (e) {
  if (e instanceof DataProcessorError && e.status === 404) { /* not found */ }
}

API surface

| Group | Methods | Purpose | | --------- | -------------------------------------------------------- | ------- | | ingest | ingest, records.list, records.get | push data in (shared type/source/webhook via opts), inspect what you sent | | processed | getProcessed, pollProcessed, getProcessedRecord | pull backstop for results | | health | health | liveness |

Any non-2xx response throws a DataProcessorError carrying .status and the parsed .body.

Configuration

new DataProcessorClient({
  baseUrl: 'https://data-processor.internal',
  headers: { 'x-some-header': 'value' }, // applied to every request
  fetch: customFetch,                    // optional; defaults to global fetch
});