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

exports-shadow

v0.1.1

Published

Prints the file Node, Bun, Deno and workerd resolve for each exports subpath, and flags hidden runtime keys.

Readme

exports-shadow

ci npm JSR license

exports-shadow prints the file Node, Bun, Deno and workerd resolve for each exports subpath, and flags runtime keys that an earlier key hides.

┌─ keys are tried top to bottom ─────────────────────────────────┐
│ "exports": { ".": {                                            │
│   "node":    "./dist/node.js",    <- node, bun, deno stop here │
│   "bun":     "./dist/bun.js",     never reached                │
│   "deno":    "./dist/deno.js",    never reached                │
│   "default": "./dist/default.js"  <- workerd stops here        │
│ } }                                                            │
└────────────────────────────────────────────────────────────────┘

Each runtime takes the first key in its own condition set. Bun and Deno both include "node", so a "bun" or "deno" key placed after it never wins. Wrangler's defaults (workerd, worker, browser) leave out node, but an earlier "browser" or "import" key can hide a Workers file the same way.

Install

npm:

bun add -d exports-shadow
npm i -D exports-shadow

JSR:

bunx jsr add @kanchingyg/exports-shadow

From a clone:

bun install
bun run build
node dist/cli.js fixtures/shadow-order

Quick start

Fixture ordered node → bun → deno → default, each path a different file. Bun 1.4.2 and Node 22 both printed RESOLVED=node when importing it. The deno row comes from Deno's documented conditions. Deno was not run on this fixture.

$ exports-shadow fixtures/shadow-order

[email protected]

shadow  .
          node     ./dist/node.js
          bun      ./dist/node.js  <- shadow (node before bun)
          deno     ./dist/node.js  <- shadow (node before deno)
          workerd  ./dist/default.js

shadow: a runtime-specific key exists but an earlier broader key wins

Exit 0 when nothing is shadowed, 1 on shadow, 2 on error.

Use

Pass a directory, a package.json path, or an installed package name. Default target is the current directory.

| Flag | What it does | Default | | --- | --- | --- | | --json | Print a machine-readable report (schemaVersion 1) | off | | --runtime <list> | Limit columns to a subset of node,bun,deno,workerd | all four | | --fix | Print a suggested reordered exports object (no write) | off | | --apply | Write that reorder after you type apply (backup first) | off | | --undo | Restore the last --apply backup | off | | --yes | Skip confirmation for --apply / --undo | off |

--apply copies package.json to package.json.exports-shadow.bak and writes .exports-shadow-state.json next to it. --undo restores the backup.

Library API

import { scan, resolveSubpath, detectShadow, suggestReorder } from "exports-shadow";

const report = scan("./packages/sdk");
// report.rows[n].cells[m].resolved / .shadow
// report.suggestedExports: reorder suggestion
// scan() does not write files

How it works

The CLI and scan() walk every exports subpath for the four runtimes in ALL_RUNTIMES: node, bun, deno, and workerd. Condition sets are pinned in src/conditions.ts from the Node, Bun, Deno, and Wrangler docs. Resolution goes through resolve.exports with those sets. A cell is shadowed when a runtime-specific key (bun, deno, workerd, worker) exists but an earlier broader key (node, import, require, default, browser, and related) wins.

Limits

Condition sets are pinned in source. The tool does not read them from the installed runtime. Only node, bun, deno, and workerd are covered. Deno and workerd were not run on the fixtures/shadow-order fixture. The deno and workerd columns follow the documented condition lists above.

Evidence on public packages

Checked on the installed tarball (npm's web JSON can reorder keys):

| Package | What shadows | |---|---| | [email protected] | node before bun on ., ./pack, ./unpack | | [email protected] | browser before worker / workerd on . | | [email protected] | browser before worker / workerd on . |

Reported elsewhere

License

AGPL-3.0-only. Free and open source. If you ship a modified version, or run a modified version as a network service, you must publish that source under the AGPL. Closed-source or proprietary commercial use needs a separate license from the author (dual licensing); ask via GitHub.

Copyright (c) 2026 Augusto Cerrutti (https://github.com/kanchingyg)