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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dtifx/diff

v4.1.6

Published

Production DTIF diff engine with reporters, formatters, and CI integrations.

Readme

Overview

@dtifx/diff analyses DTIF token snapshots and turns them into actionable change reports. It powers human-friendly summaries, machine-readable outputs, and CI gates that understand semantic impact.

Installation

pnpm add -D @dtifx/cli @dtifx/diff
# or
npm install --save-dev @dtifx/cli @dtifx/diff

The diff engine requires Node.js 22 or later. Use it through the shared CLI or embed the API in custom tooling.

Usage

Command line

pnpm exec dtifx diff compare tokens/base.json tokens/feature.json --format markdown --summary
pnpm exec dtifx diff compare tokens/base.json tokens/feature.json --fail-on-breaking --filter-type color
pnpm exec dtifx diff compare tokens/base.json tokens/feature.json --format html --output report.html

[!NOTE] The CLI expects concrete file paths.

If you prefer comparing Git refs, wrap the command with shell helpers such as pnpm exec dtifx diff compare <(git show main:tokens/index.json) tokens/index.json or extract the ref contents to temporary files before invoking the CLI.

Helpful flags:

  • --format <cli|markdown|html|json|yaml|sarif|template> – Choose the output format.
  • --output <file> – Write the rendered diff to disk instead of stdout.
  • --filter-type <types> / --filter-impact <impacts> / --filter-path <paths> – Narrow which changes appear.
  • --fail-on-breaking / --fail-on-changes – Enforce quality gates for CI pipelines.
  • --summary / --mode <mode> – Control the verbosity of the report.

Node.js API

import { createRunContext, createSessionTokenSourcePort, runDiffSession } from '@dtifx/diff';

const sources = {
  previous: { kind: 'file', target: 'tokens/base.json' },
  next: { kind: 'file', target: 'tokens/feature.json' },
};

const session = await runDiffSession(
  {
    tokenSource: createSessionTokenSourcePort(sources),
    diagnostics: { emit: console.error },
  },
  {
    filter: { types: ['color'] },
    failure: { failOnBreaking: true },
  },
);

const context = createRunContext({ sources, startedAt: new Date(), durationMs: 640 });
console.log(session.filteredDiff.breaking.length, context.previous);

Extend the behaviour with custom rename, impact, and summary strategies when needed.

Examples

Further reading

License

MIT