Versioning & Packages

package.json exportsvisualizer

Paste a manifest, choose an entry and see which condition wins in the current Node resolution preview.

package.json exports

package.json input

Your manifest stays in this browser; no registry or file upload is used.

Resolution result

Enter a package.json manifest to begin.

Resolution options

Separate extra conditions with spaces or commas. Browser and bundler behavior is only a selected-condition preview.

Input or options changed. Resolve again before exporting.

When a package works through import but fails through require, the same package.json exports map can select a different file. The ordering of condition keys is often the missing clue.

This package.json exports view follows one requested entry through the branch order. It also tests internal # imports aliases without pretending to read the package's actual files.

Why inspect package.json exports visually?

See the first winning branch

In conditional exports, an object is tested in JSON key order, not the order of your selected conditions. The branch view marks inactive keys and the target that won, including a default key that can shadow later import branches.

Two alternative branch routes from one package entry, with the first matching condition highlighted.

Separate public paths from internal aliases

Use package.json exports for public . and ./feature requests, then test a #config imports alias in the same manifest. A null target appears as an explicit block rather than a missing file claim.

A package map splitting into public entry paths and a private hash alias, with a blocked branch shown.

Trace one request without guessing the resolver

01

Try a package name or hash alias

A request such as sample-kit/feature is normalized from the manifest name to ./feature. A #config request switches to imports and is valid only inside that package.

02

Switch the condition context

Node.js with import is the default. Change to require or add a custom condition to see which earlier key wins. Auto resolve waits 350 ms; turning it off reveals a button and Ctrl or Cmd plus Enter.

03

Read the selected branch before exporting

The result lists the matched key, condition order and target. A path diagnostic checks syntax only; it cannot prove that a target file exists. Any edit disables copying an older report.

Inspect entry selection at each layer

One entry, full branch trace

Test root, exact subpath and * pattern requests. Exact keys take precedence over patterns; more specific patterns win before broad ones, and null can reserve a private subpath.

Node and selected-condition views

Compare import and require under Node.js defaults. Add development, browser or types as explicit conditions when exploring a possible toolchain context; the view does not emulate that toolchain.

Local path diagnostics

The map checker rejects traversal and node_modules segments in local targets, and accepts external package targets only for imports aliases. It reports map errors without executing code.

What the mapping result can establish

No file existence verdict
A resolved path is a string chosen from package.json exports or imports. The manifest alone cannot show whether that file exists, appears in a published tarball, or loads successfully.
Custom conditions are a preview
Selecting browser or types does not reproduce Vite, webpack or TypeScript resolution. Those tools have additional rules for fields, extensions and type declarations. Node.js import and require are the supported presets.
Internal imports stay internal
A # alias is resolved through imports for code inside the same package. It is not an exported public entry, even when it points at another package.
No registry or build inspection
The page never fetches npm data, scans the package directory, executes scripts, generates a new export map or checks compatibility across Node versions.

package.json exports questions

Does the order of keys in package.json exports matter?

Yes. Conditions are checked in object key order; the first active branch with a target wins. Placing default early can hide import or require branches below it. The trace keeps the original order visible.

What is a subpath pattern in Node.js?

A key such as ./features/* matches a request suffix, then substitutes that suffix into the target. An exact key has priority, while a more specific pattern beats a broad one. A null mapping can block a private area.

Why is a package subpath not exported?

Once exports is present, an unlisted package subpath is not publicly available. Enter the full package name or ./subpath to see whether an exact key or pattern matches; a null match is an intentional block.

How do I test import and require conditions?

Switch the module call option. Under Node.js, import and require activate different built-in conditions, while key order in the mapping remains fixed. The branch trace shows the resulting target.

Can an exports target point outside a package?

No. Local exports targets must start with ./ and cannot traverse upward or enter node_modules. This tool reports such path syntax; a syntactically valid path still needs a real package file.

How do package imports beginning with # resolve?

Enter a # alias and the view uses the manifest's imports map. These aliases are private to the package and may point to another package; the page shows the selected string without resolving that dependency.

Another mapping problem?

Test package.json exports now

Use the package.json exports visualizer to compare import and require on the same entry, then export the branch report for review.