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

@meteroid/node

v0.30.1

Published

Official Node.js / TypeScript SDK for Meteroid, the open-source billing platform: subscriptions, invoicing, usage-based billing and webhooks.

Readme

Meteroid Node.js SDK

The official Node.js / TypeScript SDK for Meteroid, the open-source billing and pricing platform. Meteroid manages subscriptions, usage-based billing and metering, invoicing and revenue analytics; this library calls its REST API and verifies its webhooks, against Meteroid Cloud (https://api.meteroid.com) or a self-hosted instance.

Website · Documentation · API reference · Meteroid on GitHub

npm install @meteroid/node

The package ships ESM and CommonJS builds and runs on Node.js 20+, Deno, Bun, browsers and edge runtimes: it only needs fetch. Every method of the API is listed in api.md.

Usage

import { Meteroid } from "@meteroid/node";

const client = new Meteroid({ apiKey: "your-api-key" });

const addOn = await client.addOns.retrieve("addon_id");
console.log(addOn);

Without apiKey, the client reads the METEROID_API_KEY environment variable, and without baseURL the METEROID_BASE_URL one, then https://api.meteroid.com. The other options are timeout (milliseconds), maxRetries, defaultHeaders, defaultQuery, fetch, middleware and debug.

Every API area is a property of the client, and every method takes a last RequestOptions argument: { signal, headers, query, timeout, maxRetries, idempotencyKey }.

Models

Models are plain objects with camelCase properties, converted from and to their JSON form by XSerializer.parse(json) and XSerializer.serialize(value). Properties the API sends that this version of the SDK does not know are kept under their JSON names, and sent back when the object is serialized: (value as typeof value & { new_field?: string }).new_field.

Errors

Everything the SDK throws is a MeteroidError:

| Error | When | |---|---| | APIError | A non-2xx response: status, headers, requestId, body (the raw text) and error (the body parsed with its declared schema, else as JSON) | | BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError | APIErrors of statuses 400, 401, 403, 404, 409, 422, 429 and 5xx | | APIConnectionError | No response: DNS, TLS or network failure, with the transport error as cause | | APIConnectionTimeoutError | No response within the timeout (an APIConnectionError) | | APIUserAbortError | The call's signal aborted | | APIDecodeError | A successful response that is not valid JSON or not the expected event stream |

import { NotFoundError } from "@meteroid/node";

try {
  await client.addOns.retrieve("addon_id");
} catch (error) {
  if (error instanceof NotFoundError) {
    console.log(error.status, error.requestId, error.error);
  }
}

Raw responses

Every method returns an APIPromise: await it for the parsed body, or ask for the HTTP response too.

const { data, response, requestId } = await client.addOns.retrieve("addon_id").withResponse();
const raw: Response = await client.addOns.retrieve("addon_id").asResponse(); // body unread

Pagination

List methods return a PagePromise. Await it for the first Page: the response body, whose properties are read on the page, with items (the items of the page), hasNextPage(), getNextPage() and iterPages(). A property named like one of these stays on page.body, the decoded body, next to page.response. Iterating a PagePromise or a Page with for await yields every item, the next pages being fetched on demand.

const page = await client.addOns.list();
console.log(page.items, page.paginationMeta?.totalPages);

for await (const addOn of client.addOns.list()) {
  console.log(addOn);
}

for await (const each of page.iterPages()) {
  console.log(each.items.length, each.hasNextPage());
}

Retries and timeouts

Connection errors, timeouts, 408, 429 and 5xx responses are retried twice with exponential backoff, honouring Retry-After and retry-after-ms, when the request is idempotent or carries an Idempotency-Key. Each attempt times out after timeout milliseconds (Infinity waits forever).

const client = new Meteroid({ maxRetries: 5, timeout: 20_000 });
await client.addOns.retrieve("addon_id", { maxRetries: 0, timeout: 5_000 });

middleware wraps every attempt, for logging, caching or custom headers, and fetch replaces the fetch implementation.

  • Source: https://github.com/meteroid-oss/meteroid-node
  • License: Apache-2.0

Generated by perseid.