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

@middag-io/licensing

v0.2.0

Published

MIDDAG protected code delivery — build-time placeholder injection, manifest contract, and runtime loader for licensed JS modules

Downloads

276

Readme

@middag-io/licensing

Protected code delivery for MIDDAG products.

@middag-io/licensing standardizes how MIDDAG plugins (Moodle, WordPress, and future hosts) ship licensed JavaScript modules through a CDN. The package owns the technical contract (placeholders, manifest schema, types). The licensing worker owns the policy (which install gets which module, when, signed with what key).

Install

npm install @middag-io/licensing

Published to GitHub Packages (@middag-io scope). Configure .npmrc with a token that has read:packages for installs and write:packages for releases.

Subpath exports

| Import | Purpose | |---|---| | @middag-io/licensing | Shared contract types (CONTRACT_VERSION, PLACEHOLDERS, manifest interfaces). | | @middag-io/licensing/contract | Same as root — explicit subpath. | | @middag-io/licensing/build | Vite plugin and CLI helpers that inject placeholders and emit manifest.template.json. Node-only. | | @middag-io/licensing/client | Runtime loader for the host. Validates the worker-issued manifest and dynamically imports protected modules. | | @middag-io/licensing/anti-tamper | ADR-014 Layer 2: ClientIntegrityWatcher (prototype freeze + MutationObserver) + ClientIntegrityReporter (POST worker /v1/anti-tamper/client-report). | | @middag-io/licensing/observability | ADR-015: ObservabilityClient + BatchSender + PerfCollector. Posts batched browser errors / perf / audit events to a host plugin relay (PHP signs+forwards). | | @middag-io/licensing/telemetry | ADR-015 telemetry redirect: TelemetryClient + UsageTracker sugar over observability audit events. | | @middag-io/licensing/remote-support | Optional AuditBanner widget rendering active session info on tenant admin dashboards (ADR-013 extended). |

Status

v0.2.0 — adds 4 new client subpaths matching worker contract v0.3.0 (ADR-013 extended remote support, ADR-014 anti-tamper, ADR-015 observability + telemetry). Initial v0.0.2 release shipped ADR-012 protected-delivery loader; that surface is unchanged. The Vite plugin emits manifest.template.json with SHA-384 hashes; the runtime loader verifies the worker-issued JWS against the worker JWKS, validates the bootstrap (install / host / product / contract version), and dynamic-imports modules with recomputed SRI.

Locked placeholder set (worker substitutes these per install):

  • __MIDDAG_HOST_ORIGIN__
  • __MIDDAG_INSTALL_ID__
  • __MIDDAG_KID__
  • __MIDDAG_BUNDLE_EXPIRES_AT__
  • __MIDDAG_NONCE__

Adding, removing, or renaming a token is a coordinated worker change (src/lib/manifest-materialize.ts:PLACEHOLDERS) and a CONTRACT_VERSION bump.

Design contract: worker-ts-middag-licensing/docs/explanation/spec-licensing-js-lib.md.

Development

npm install
npm run build
npm run typecheck
npm run test
npm run lint

Release

  1. npm run changeset to record the intent.
  2. Merge to main. The Release workflow opens a "Version Packages" PR.
  3. Merge that PR to publish.

License

Proprietary — MIDDAG.