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

@oimlsmart/oiml-pubid

v1.1.0

Published

The OIML publication identifier system: the parser and the URN convention — the single source of truth for every OIML SMART consumer.

Readme

@oimlsmart/oiml-pubid

The OIML publication identifier system — the single source of truth for parsing OIML document identifiers and minting their URNs. Every OIML SMART consumer (Primmel Studio, the smart platform, the docs sites) imports from this package. Nothing reimplements; nobody pins their own expectations — the conformance corpus is shared.

What it is

  • parseOimlPubid(src, bibdataYear?) → OimlPubid | null — a real tokenizer + recursive-descent grammar (never a regex). Parses the publication families (R, B, D, G, E, V) and the OIML-CS family (PD, OD, CID) with parts, years, editions, and amendments; returns null for non-OIML shapes.
  • urnForOimlPubid(pubid) → string — the OIML URN convention, composed from the parsed structure:
    • pub series → urn:oiml:pub:{family}:{number}[-{part}][:{year}]
    • CS series → urn:oiml:pub:cs:{family}-{number}[:{year}]
  • urnForIdentifier(src, bibdataYear?) → string | null — the one-call convenience.
  • conformance/identifiers.jsonthe shared expectations. Every consumer's tests run against this file; nobody pins their own copies. The package's own suite is proof it stays honest.

The grammar

pubid      := "OIML" ["-CS"] family number ["-" part] [":" year]
              ["(" lang ")"] ["Edition" n] ["(Amendment" n ")"]
family     := "R" | "B" | "D" | "G" | "E" | "V"   (publications)
family     := "PD" | "OD" | "CID"                  (the CS family)
number     := digits · part := digits · year := 4 digits
lang       := "(" letter+ ")"       e.g. (E), (F), (E/F)
"Edition"  := n                    e.g. Edition 6
amendment  := "(Amendment" n ")"

The instrument segment (TODO.register/04)

Additive to the grammar — the per-serial identity of one registered instrument, never a reinterpretation of the publication identifiers above (src/instrument.ts, ./instrument):

instrument := "urn:oiml:instrument:" authority ":" holder ":" certificate ":" serial
link       := "/i/" authority "/" holder "/" certificate "/" serial
authority  := the scheme authority operating the register (the register
              operator's federation instance id, e.g. oiml-cs-hub)
holder     := the holder organization id (the identity plane's org id)
certificate := the certificate number the serial rides under
serial     := the serial number

Every segment is pct-encoded individually (the keep-set is the URI unreserved characters), so a certificate number's / or a serial's : never splits the grammar. The link form is the GS1 Digital Link pattern: the serialized code on the rating plate resolves (/i/<serial-identity>) on the register's public origin.

  • mintInstrumentUrn(parts) / instrumentLinkPath(parts) — the two canonical forms (a malformed mint — an empty segment — throws).
  • parseInstrumentUrn(src) / parseInstrumentLinkPath(path) — null for every malformed shape.
  • conformance/instruments.json — the shared expectations for the segment (@oimlsmart/oiml-pubid/conformance/instruments).

Usage

import { parseOimlPubid, urnForOimlPubid, urnForIdentifier } from '@oimlsmart/oiml-pubid';
import corpus from '@oimlsmart/oiml-pubid/conformance';

urnForIdentifier('OIML B 18:2025(E)')              // urn:oiml:pub:b:18:2025
urnForIdentifier('OIML R 7', '1979')               // urn:oiml:pub:r:7:1979
urnForIdentifier('OIML-CS PD-05 Edition 6', '2024') // urn:oiml:pub:cs:pd-05:2024

// The conformance corpus in your own tests:
for (const c of corpus.cases) {
  assert.equal(urnForIdentifier(c.identifier, c.bibdataYear ?? ''), c.urn);
}

Gates

npm run build   # tsc + the browser bundle (vite)
npm test        # the conformance suite (node:test over the corpus)