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

data-cap

v0.3.1

Published

Executable, analyzable data contracts. Capabilities declare the fields they own and the getters/mutators/subscriptions that acquire, mutate, or observe them, independent of databases, transports, frameworks, and state-management libraries.

Readme

data-cap

CI npm version License: MIT Bundle size TypeScript

Your application's data should have an owner.

data-cap treats application data as a capability-owned contract: its fields, the operations that acquire or change them, and the code that depends on them.

Existing tools help with fetching, caching, and managing data.

data-cap answers why the data exists, who owns it, and where it is used.

You keep everything you have. data-cap does not replace TanStack Query, Redux, Zustand, Apollo, or plain fetch + useState. It gives those tools a stable contract around the data they already manage.

See it run

Define a capability around the data your application owns:

const user = createData({
  fields: {
    profile: UserProfileSchema,
    preferences: UserPreferencesSchema,
  },

  getters: {
    load: async () => fetchUser(),
  },

  mutators: {
    updatePreferences: async (preferences) => {
      await updateUserPreferences(preferences)
    },
  },
})

Then inspect the application as a whole:

$ npx data-cap --root . --include "src/**"

Discovered 1 active capability(ies).

Manifest changes since last execution:

  No changes.

Wrote docs: docs/DATA.md
Wrote dependency & ownership report: docs/OWNERSHIP.md

The generated artifacts make the contract visible to developers, reviewers, and automated contributors.

Why it exists

Application data tends to outlive the code that first introduced it.

A field gets added to an API response. A second component starts depending on it. A mutation changes it. A cache begins supplying it. Eventually nobody can easily answer:

  • Why does this data exist?
  • Who owns it?
  • What can change it?
  • Where is it used?

Existing data tools answer different questions. Fetching libraries retrieve data. Caches manage freshness and reuse. State libraries manage application state.

data-cap adds the missing ownership layer.

Quick start

Install the package:

npm install data-cap

Define a capability around data your application owns:

const account = createData({
  fields: {
    balance: 0,
    status: "active" as "active" | "suspended",
  },

  getters: {
    load: async () => getAccount(),
  },

  mutators: {
    suspend: async () => suspendAccount(),
  },
})

Use the capability from your application without coupling its ownership to a particular transport, database, framework, or state library.

For the full API and integration patterns, see the Guide.

Why not just use your existing data library?

| Tool | Primary question | | --------------- | ---------------------------------------------------------------- | | fetch | How do I retrieve this? | | TanStack Query | How do I fetch and cache this? | | Redux / Zustand | How do I manage this state? | | Apollo | How do I manage GraphQL data? | | data-cap | Why does this data exist, who owns it, and where is it used? |

These concerns can coexist.

For example, TanStack Query can remain responsible for fetching and caching while data-cap defines the application's ownership contract around the resulting data.

From one capability to a whole application

A capability can be inspected independently or as part of the application.

The build tooling can generate a manifest, documentation catalog, dependency and ownership report, and other artifacts that make data relationships visible across the repository.

See the examples/ directory for complete applications and the migration guides.

You probably don't need it when

data-cap is probably unnecessary if your application is small enough that data ownership, dependencies, and usage are already obvious.

It becomes useful when data crosses component, feature, team, or system boundaries and those relationships become difficult to see.

Works with automated contributors

Generated manifests and ownership documentation give automated contributors repository-local context about application data.

That makes data changes easier to inspect, review, and govern without relying entirely on tribal knowledge.

Status

data-cap is pre-1.0.

The core runtime, build tooling, CLI, ESLint integration, manifest generation, documentation generation, and ownership analysis are implemented and tested. createData is currently Experimental; lower-level runtime primitives are Stable.

Learn more

If this is useful

If data-cap helps make your application's data easier to understand and maintain, consider giving the project a star or sharing it with someone working on application architecture.

Contributing

Contributions are welcome. Read CONTRIBUTING.md before opening an issue or pull request.

License

See LICENSE.