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

recollie

v2.0.1

Published

A tiny Node.js client for searching public recall APIs.

Readme

recollie

A tiny, dependency-free Node.js client for searching public US recall APIs. First published in 2014. Modernized to v2.0.0 in 2026. The 12-year gap is the point.

npm version License: MIT Node Zero dependencies

What this is

recollie is a small client library for querying public US recall APIs. You give it a search term; it returns the matching recall records from the upstream API.

It is also a personal artifact. The first version shipped to npm in 2014, when I was learning JavaScript and building tooling around full-stack work that predated the agentic-AI era. v2.0.0 shipped in 2026 as a deliberate exercise in maintaining useful developer tooling across a long gap.

The library has stayed honest about what it is the whole time:

  • One thing it does well: query public recall data
  • Zero runtime dependencies
  • Small, readable, typed surface area

What changed in v2.0.0

  • Node 18+ baseline, native fetch (no node-fetch dependency)
  • TypeScript declarations shipped with the package
  • Structured errors (RecollieError) with stable, machine-readable error codes
  • New default data source. Early versions queried the old USA.gov aggregate recall endpoint, which is no longer active; v2.0.0 defaults to the CPSC recalls API
  • Continuous integration on push and PR (Node 18, 20, 22)
  • Same zero-runtime-dependency promise as v1

Install

npm install recollie

Quick start

const recollie = require('recollie');

// Searches the CPSC recalls API (the default) by product name.
const recalls = await recollie('crib', { limit: 5 });

for (const recall of recalls) {
  console.log(recall.Title);
}

The named search export is identical to the default call:

const { search } = require('recollie');

const recalls = await search('crib');

API

const recalls = await recollie(term, options);

term is a required, non-empty string. options is optional:

| Option | Default | Description | |---|---|---| | endpoint | CPSC recalls API | API endpoint URL. | | queryParam | "ProductName" | Query parameter used for the search term. | | queryPrefix | "" | Prefix added before the term for fielded-search APIs. | | params | {} | Extra query parameters (values are stringified). | | limit | 25 | Local cap for array or { results: [] } responses. null disables. | | timeoutMs | 10000 | Request timeout in milliseconds. | | headers | {} | Additional request headers. | | fetch | globalThis.fetch | Custom fetch implementation (for tests or non-standard runtimes). |

recollie returns the parsed JSON from the upstream API, optionally length-limited. The shape is whatever the endpoint returns — the library does not normalize it.

Querying other APIs

The endpoint is configurable, so the same client works against other recall APIs. For example, openFDA food enforcement uses search=product_description:<term>:

const results = await recollie('peanut butter', {
  endpoint: 'https://api.fda.gov/food/enforcement.json',
  queryParam: 'search',
  queryPrefix: 'product_description:',
  params: { limit: 5 },
  limit: 5,
});

Callbacks

Error-first callbacks are supported, and the legacy success-only callback still works:

recollie('crib', { limit: 5 }, (error, recalls) => {
  if (error) return console.error(error);
  console.log(recalls);
});

Prefer the Promise API or error-first callbacks for new code so failures are explicit.

Errors

Operational failures reject with a RecollieError carrying a stable code:

FETCH_UNAVAILABLE · HTTP_ERROR · INVALID_JSON · REQUEST_FAILED · TIMEOUT

HTTP_ERROR also carries status and body. Invalid caller input (such as an empty term) throws a TypeError.

try {
  await recollie('crib');
} catch (error) {
  if (error instanceof recollie.RecollieError) {
    console.error(error.code, error.status);
  }
}

Design choices

  • Zero runtime dependencies. A package that has lived more than a decade in npm has watched a lot of dependencies disappear. This one doesn't have any to lose.
  • Native fetch only. Node 18+ is the floor.
  • Server-only. This is a Node library, not a browser library. CORS for these public APIs is variable and not worth pretending to abstract over.
  • No magic retries. You get a configurable timeoutMs and can supply your own fetch; the retry policy is the caller's to choose.

Why it still ships

I keep this package alive for one reason: it is a verifiable, third-party-hosted (npm registry) record of writing and maintaining production code across a long horizon. That matters more to me than the size of the user base. If it helps you find a recall faster, that is a bonus.

Where this fits

| Role | Project | |---|---| | This repo | recollienpmjs.com/package/recollie | | Author's GitHub profile | github.com/roymcfarland | | Other public infra repos | Atlas Beta Bug Reporter · Workflow Blueprint · Agentic Daily Digest · Builder & Verifier methodology |

Data sources

Recall data can change and may be incomplete. Verify safety-critical decisions with the responsible agency or manufacturer.

Versioning

Semantic versioning. v1.x is preserved on npm for historical reference. v2.0.0 introduces TypeScript declarations, structured errors, and a new default data source as breaking changes against the v1 surface; everything else attempts to remain familiar.

License

MIT.

Author

Roy McFarland — brightline.io · [email protected]