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

@opendpp/testdata

v0.3.0

Published

Deterministic synthetic sample-passport and EPCIS-shaped event-chain generator for the OpenDPP Digital Product Passport API — category-valid ESPR sample data for every category the public contract recognises (ESM, Node >=26).

Readme

@opendpp/testdata

Deterministic synthetic sample-data generator for the OpenDPP Digital Product Passport API (ESM, Node ≥ 26). One call (or one npx) mints category-valid sample passports — for every ESPR category the public contract recognises — in the exact shape POST /api/v1/passports and /passports/bulk accept, plus EPCIS-shaped supply-chain event chains. No more hand-crafting ESPR payloads to try an integration.

Part of the OpenDPP open client surface (Apache-2.0). Samples are structurally valid against the public per-category schemas (GET /api/v1/schemas/{category}); the hosted node stays authoritative for validation, GS1 check-digit enforcement, operator binding, eIDAS sealing and the vcReady / warnings signals. See opendpp-interop.

Synthetic by construction: fictional operators and facilities marked (SAMPLE), GTINs minted under a fictional GS1 company prefix (0950110154, valid mod-10 via @opendpp/gs1), and example.opendpp-node.eu URLs. Nothing describes a real product, operator or facility, and nothing asserts a regulatory status.

CLI

npx @opendpp/testdata batteries --count 10                 # POST-ready passport JSON
npx @opendpp/testdata textiles --format csv > textiles.csv # portal-importable CSV
npx @opendpp/testdata batteries --format events            # canonical chains (POST /events)
npx @opendpp/testdata batteries --format epcis             # EPCIS 2.0 document (POST /events/epcis)
npx @opendpp/testdata all --count 2                        # 2 samples of every category

Flags: --count/-c, --seed/-s, --format/-f json|csv|events|epcis (all supports --format json only), --prefix (your own 10-digit GS1 prefix), --operator-id, --facility-id, --help.

Library

import { generatePassports, generateEventChain, passportsToCsv } from "@opendpp/testdata";

// 10 valid battery passports — POST each to /api/v1/passports, or all to /passports/bulk.
const passports = generatePassports({ category: "batteries", count: 10 });

// The same 10 as CSV under the official @opendpp/csv template header.
const csv = passportsToCsv("batteries", passports);

// A 4-event upstream chain (commissioning → transformation → packing → shipping)
// for one product; wrap with toUntpEventCredential() and SIGN it before POSTing
// to /api/v1/events — this package never fabricates proofs.
const events = generateEventChain(passports[0]);

// Or emit the whole chain as one conformant EPCIS 2.0 document (CBV short names,
// content-addressed eventIDs) — POST it as-is to /api/v1/events/epcis.
import { toEpcisDocument } from "@opendpp/testdata";
const epcisDoc = toEpcisDocument(passports.flatMap(generateEventChain));

Determinism

Everything derives from a seed (default 42): the same (seed, category, index) always yields the same sample, on every machine — reproducible fixtures for test suites and bug reports. Vary --seed for a different (equally reproducible) dataset. GTIN slots are addressed by (category, index, prefix) and stay stable across seeds; the content varies with the seed.

Round-trips @opendpp/csv

passportToCsvRow is the exact inverse of @opendpp/csv's mapCsvRowToPassport, guarded by a round-trip test per category — generated CSV imports losslessly. One caveat: the public CSV templates carry no productName column, so the generated display name is JSON-only.

The OpenDPP toolkit

Open (Apache-2.0) client libraries for building against the hosted OpenDPP node — install only the ones you need:

| Package | What it does | |---|---| | @opendpp/gs1 | GS1 Digital Link URIs + GTIN/GLN/GRAI check-digit validate & mint | | @opendpp/csv | Map spreadsheet / ERP rows to the passport-create shape for bulk import | | @opendpp/testdata | Deterministic, category-valid sample passports + EPCIS event chains | | @opendpp/webhooks | Webhook event types + a constant-time HMAC-SHA256 verifier | | @opendpp/eori | Validate EU EORI numbers against the Commission's EOS service | | @opendpp/aeo | Look up AEO trusted-trader status against the EOS service | | @opendpp/vies | Validate EU VAT numbers against the Commission's VIES service | | @opendpp/sdk | Generated TypeScript client for the full public API |

They integrate with the hosted node — where passports are validated against ESPR category rules, cryptographically sealed, resolved via GS1 Digital Link, and kept for the 15-year retention window. Start building: opendpp-node.eu · API reference · developer hub.

License

Apache-2.0 © Opendpp UAB. See NOTICE. "OpenDPP" is a trademark of Opendpp UAB; this license grants no rights to the marks.