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

neighborhood-commons

v0.0.4

Published

Official SDK for the Neighborhood Commons API — typed client generated from the OpenAPI spec.

Readme

Neighborhood Commons SDK

Typed client for the Neighborhood Commons API, generated from the OpenAPI spec.

The SDK is a mirror of the spec. If the spec changes, this package changes. The spec is authoritative — if this SDK ever disagrees with /openapi.json, the spec wins.

Read this first

Beyond a list view, you should read the Commons Contract Guide before building anything substantial. The SDK gives you typed access to every endpoint, but the meaning of each shape — how films cluster by tmdb_id, how attribution works via source.contributor, what open_window implies for feeds, how series IDs map to recurring events — lives in the Guide. The SDK is the floor; the Guide is what makes you build something good.

Stability promise

The Commons Spec is additive-only by intent. It grows over time as new shapes are needed, but existing shapes essentially never change. New fields are rare and considered. Breaking changes are vanishingly rare — measured in years, not months. Build against today's contract with confidence that it will still work in 18 months. See RELEASING.md for the release discipline that backs this promise.

Install

npm install neighborhood-commons

Quick start

import { createCommonsClient } from "neighborhood-commons";

const commons = createCommonsClient();

const { data, error } = await commons.GET("/events", {
  params: { query: { start_after: "2026-01-01", limit: 20 } },
});

if (error) {
  console.error(error.error.code, error.error.message);
} else {
  for (const event of data.events) {
    console.log(event.name, event.start);
  }
}

With an API key

const commons = createCommonsClient({
  apiKey: process.env.COMMONS_API_KEY,
});

Both developer-tier and service-tier keys use the X-API-Key header — pass whichever tier you hold as apiKey.

Custom base URL

const commons = createCommonsClient({
  baseUrl: "https://staging.neighborhood-commons.org/api/v1",
});

What you get

  • Typed request/response for every endpoint. IDE autocomplete; compile-time errors on drift.
  • Thin wrapper over openapi-fetch. No magic, no hidden behavior. The whole source is short enough to read in a sitting.
  • Generated from openapi.json. Spec changes propagate here on the next release.

Why this SDK stays thin

Deliberately. The whole runtime wrapper is createCommonsClient() — a few dozen lines you can read in two minutes. No retry logic, no caching, no convenience method wrappers, no "smart" defaults beyond what the spec requires.

This is by design. Every wrapper feature would widen the implicit contract beyond what the Spec actually says, making the SDK a second source of truth that drifts from openapi.json. Keep the SDK boring; build helpers in your own application layer if you need them. If a wrapper feature seems compelling enough to belong here, the right move is to propose it as a spec change first.

Type exports

Convenience type aliases for the common shapes:

import type {
  Event,
  Account,
  Group,
  Meta,
  Webhook,
  Source,
  ApiError,
  ErrorCode,
} from "neighborhood-commons";

For anything else, reach into the generated namespace:

import type { components, paths } from "neighborhood-commons";

type ServiceEventInput = components["schemas"]["ServiceEventInput"];
type ListEventsQuery = paths["/events"]["get"]["parameters"]["query"];

Caveats

  • The /events/changes endpoint lives outside the /v1 prefix. If you need it, create a second client with baseUrl pointed at .../api instead of .../api/v1, or call it directly with fetch.

Versioning

This SDK tracks the Commons Contract via semver:

  • Patch — SDK bug fix, no spec change
  • Minor — additive spec change (new optional field, new endpoint, new query parameter, new enum value). Rare — weeks to months between minors.
  • Major — breaking spec change (field removal, rename, type change). Vanishingly rare — expect years between majors.

See RELEASING.md for the additive-only discipline that drives version bumps. Watch the root CHANGELOG.md for what changed and when.

License

MIT.