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

@narrativetrace/standalone

v0.2.0

Published

Single-file NarrativeTrace bundles for plain JavaScript pages: an ES module and a classic <script> global (window.NarrativeTrace).

Readme

@narrativetrace/standalone

Single-file NarrativeTrace for plain JavaScript pages — no TypeScript, no bundler, no node_modules at runtime. One file contains @narrativetrace/core-web + @narrativetrace/proxy + @narrativetrace/browser, and loading it registers the Web Crypto id generator, so nothing else needs to be imported.

| File | Shape | Load it with | |---|---|---| | dist/narrativetrace.js | ES module | <script type="module"> / import … from "./narrativetrace.js" | | dist/narrativetrace.global.js | classic script, defines window.NarrativeTrace | <script src="narrativetrace.global.js"> | | dist/narrativetrace.d.ts | self-contained type declarations | TypeScript users of the ES module |

Both bundles are minified (~50 KiB, budget 64 KiB enforced by tests), ship source maps, and contain no Node built-ins.

Install

pnpm add @narrativetrace/standalone

Copy the file you need out of node_modules/@narrativetrace/standalone/dist/ next to your page (or serve it from there). The unpkg / jsdelivr fields point at the classic-script build, so once published a CDN URL works too.

Usage — classic script (any page, ES5-style code included)

<script src="narrativetrace.global.js"></script>
<script>
  var NT = window.NarrativeTrace;

  function Cart() { this.items = []; }
  Cart.prototype.add = function (sku, qty) { this.items.push({ sku: sku, qty: qty }); return this.items.length; };

  var ctx = new NT.SyncNarrativeContext(new NT.NarrativeTraceConfig());
  var cart = NT.traceObject(new Cart(), ctx, { add: ["sku", "qty"] }); // parameter names: JS keeps none at runtime

  cart.add("P1", 2);

  var tree = ctx.captureTrace();
  document.getElementById("trace").textContent = NT.renderIndentedText(tree); // in the page
  NT.renderToConsole(tree);                                                    // in DevTools
  NT.postToCollector(tree, { scenario: "cart" }, "/traces");                   // to a collector
</script>

Usage — ES module (no bundler)

<script type="module">
  import { NarrativeTraceConfig, SyncNarrativeContext, traceObject, renderIndentedText } from "./narrativetrace.js";
  // same API as above
</script>

When to use the regular packages instead

If your app already has a bundler (Vite, esbuild, webpack) or runs on Node, depend on @narrativetrace/core-web (browser) / @narrativetrace/core-node (Node) plus @narrativetrace/proxy and friends: smaller graphs, tree-shaking, and per-package versioning. This package exists for the "drop a script tag in a page" case.

Learn more