package.json "exports" Field Validator
CodeParse a package.json's exports map and flag common dual-package (ESM/CJS) misconfigurations: a types condition not listed first, a missing default fallback, mismatched require/import extensions, mixed subpath and condition keys, and a subpath pattern with no matching *
Paste a package.json and get its exports field checked against the structural rules Node's module resolver actually enforces, not just whether the JSON parses. It flags a types condition that isn't listed first (TypeScript won't pick it up reliably otherwise), a missing default fallback, a require condition pointing at a .mjs file or an import condition pointing at a .cjs file, subpath and condition keys mixed in the same object, and a pattern key like ./features/* whose target has no * to receive the matched text. This fills a real gap for anyone shipping a dual ESM/CJS package, where these mistakes compile fine but break at resolution time in a consumer's project.
How to use package.json "exports" Field Validator
- 1.Paste your full package.json (only the exports field is read).
- 2.Review the flagged issues, each one points at the exact path inside exports where something is missing or malformed.
- 3.Fix the errors (they break resolution) and consider the warnings (ordering and fallback conventions that TypeScript and Node both rely on).
Frequently asked questions
Use via API, SDK, or MCP
cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/package-json-exports-validator \
-H "Authorization: Bearer utx_live_..." \
-H "Content-Type: application/json" \
-d '{"text":"{\n \"name\": \"pkg\",\n \"exports\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.cjs\"\n }\n}\n"}'Get an API key from your dashboard · Full API docs →