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

@buildtovalue/library

v1.0.0

Published

Generic, ecosystem-independent artifact catalog for BuildToValue Studio (Handoff 6 S-1): the ArtifactAdapter contract plus headless search/filter/sort/count logic. Knows nothing about BPMN, DMN or any concrete artifact type — adapters plug in. Zero depend

Downloads

249

Readme

@buildtovalue/library

Generic, ecosystem-independent artifact catalog — the headless half of the BuildToValue Studio Biblioteca (Handoff 6, S-1).

Workspace-only until the npm-scope decision (pendencias.md §1). The final published name will be <scope>/library.

What it is

A catalog that does not know what it catalogs. This package defines:

  • the ArtifactAdapter contract ({ id, typeLabel, list, get, subscribe? }) — anyone who knows a concrete artifact type (BPMN diagram, prompt, DMN decision, recipe…) implements it and plugs in;
  • the shared six-state LifecycleStatus vocabulary (draft | test | candidate | active | deprecated | retired) — structurally compatible with @buildtovalue/core's VersionStatus, with no import;
  • the headless catalog logic: createLibraryCatalog(adapters) aggregates registered adapters and implements text search, status/type filtering, sorting (name | updated | status) and chip counts — 100% testable without a DOM.

Everything an adapter provides is data: thumbnails as ThumbnailSpec (SVG string / icon name), actions as ArtifactAction descriptors the host resolves. The catalog is read-only by construction — there is no mutation path.

Independence guarantee

This package imports nothing from the monorepo (not core, not registry, not react) and declares zero dependencies of any kind. This is Handoff 6 acceptance criterion §10.2 and it is enforced by tests/independence.test.ts (same spirit as scripts/check-no-runtime-deps.mjs, applied to this package's import graph). A violation is an architecture bug, never an acceptable exception.

Usage

import { createLibraryCatalog, type ArtifactAdapter } from '@buildtovalue/library';

const catalog = createLibraryCatalog([bpmnDiagramAdapter, promptAdapter], {
  onWarning: (w) => console.warn(`[library] ${w.adapterId}: ${w.message}`),
});

const { items, counts } = await catalog.list({
  text: 'onboarding',
  statuses: ['active', 'candidate'],
  sort: 'updated',
});

const detail = await catalog.get(items[0].ref); // routed to the owning adapter

Registration validates adapters (unique id, non-empty typeLabel) with warnings, never crashes — invalid adapters are dropped, the catalog keeps working. A failing list() from one adapter likewise warns and leaves the others intact.

Notes on the contract (deviations documented)

  • ArtifactSummary.updatedAt?: string (ISO) is an extension over the Handoff 6 §3 contract: the §4 requirement of sorting by "atualização" needs a date. Optional — items without it sort after dated ones, tie-breaking by name.
  • Chip counts are computed over the text-filtered set before status and adapter narrowing, so each chip shows what selecting it would yield.