astock-agent/frontend/node_modules/node-exports-info
2026-04-07 20:51:00 +08:00
..
.github first commit 2026-04-07 20:51:00 +08:00
node_modules/.bin first commit 2026-04-07 20:51:00 +08:00
test first commit 2026-04-07 20:51:00 +08:00
.nycrc first commit 2026-04-07 20:51:00 +08:00
CHANGELOG.md first commit 2026-04-07 20:51:00 +08:00
eslint.config.mjs first commit 2026-04-07 20:51:00 +08:00
getCategoriesForRange.d.ts first commit 2026-04-07 20:51:00 +08:00
getCategoriesForRange.js first commit 2026-04-07 20:51:00 +08:00
getCategory.d.ts first commit 2026-04-07 20:51:00 +08:00
getCategory.js first commit 2026-04-07 20:51:00 +08:00
getCategoryFlags.d.ts first commit 2026-04-07 20:51:00 +08:00
getCategoryFlags.js first commit 2026-04-07 20:51:00 +08:00
getCategoryInfo.d.ts first commit 2026-04-07 20:51:00 +08:00
getCategoryInfo.js first commit 2026-04-07 20:51:00 +08:00
getConditionsForCategory.d.ts first commit 2026-04-07 20:51:00 +08:00
getConditionsForCategory.js first commit 2026-04-07 20:51:00 +08:00
getRange.d.ts first commit 2026-04-07 20:51:00 +08:00
getRange.js first commit 2026-04-07 20:51:00 +08:00
getRangePairs.d.ts first commit 2026-04-07 20:51:00 +08:00
getRangePairs.js first commit 2026-04-07 20:51:00 +08:00
isCategory.d.ts first commit 2026-04-07 20:51:00 +08:00
isCategory.js first commit 2026-04-07 20:51:00 +08:00
LICENSE first commit 2026-04-07 20:51:00 +08:00
package.json first commit 2026-04-07 20:51:00 +08:00
ranges.d.ts first commit 2026-04-07 20:51:00 +08:00
ranges.js first commit 2026-04-07 20:51:00 +08:00
README.md first commit 2026-04-07 20:51:00 +08:00
tsconfig.json first commit 2026-04-07 20:51:00 +08:00
types.d.ts first commit 2026-04-07 20:51:00 +08:00

node-exports-info Version Badge

github actions coverage License Downloads

npm badge

Info about node exports field support: version ranges, categories, etc.

Categories

  • pre-exports: versions before node supported exports in any way (< 12.17)
  • broken: versions that have a broken exports implementation. These only support the string form, and array fallbacks. (13.0 - 13.2)
  • experimental: versions where exports support was experimental. These only support the “default” condition in the object form. (13.3 - 13.6)
  • conditions: the first versions where exports support was unflagged. (13.7 - 13.12)
  • broken-dir-slash-conditions: conditions, but directory exports (ending in ./) are broken in these versions (12.17 - 12.19 || ^13.13 || 14.0 - 14.12)
  • patterns: support for “patterns” was added in these versions, and directory exports (ending in ./) are broken (^12.20 || 14.13 - 14.18 || 15.x || 16.0 - 16.8)
  • pattern-trailers: support for “pattern trailers” was added in these versions (^14.19 || 16.9 - 16.13)
  • pattern-trailers+json-imports: pattern-trailers, and JSON can be imported (^16.14)
  • pattern-trailers-no-dir-slash: support for directory exports (ending in ./) was removed for these versions (17.0)
  • pattern-trailers-no-dir-slash+json-imports: pattern-trailers-no-dir-slash, and JSON can be imported (17.1 - 19 || 20 - 20.18 || ^21 || 22 - 22.11)
  • require-esm: ESM files can be required (23 - 23.5 || 22.12 - 22.17 || ^20.19)
  • strips-types: these versions also automatically strip types from typescript files, for both require and import (23.6 - 25.3 || ^22.18)
  • subpath-imports-slash: these versions support #/ subpath imports patterns in the imports field, e.g. "#/*": "./src/*.js" (>= 25.4)

Entry points

  • node-exports-info/getCategoriesForRange: takes a node semver version range; returns an array of categories that overlap it
  • node-exports-info/getCategory: takes an optional node semver version (defaults to the current node version); returns the latest category that matches it
  • node-exports-info/getCategoryFlags: takes a category; returns an object with boolean flags { patterns, patternTrailers, dirSlash } indicating which exports features are supported
  • node-exports-info/getCategoryInfo: takes a category and an optional moduleSystem ('require' or 'import'); returns an object with conditions (array or null) and flags (from getCategoryFlags)
  • node-exports-info/getConditionsForCategory: takes a category and an optional moduleSystem ('require' or 'import'); returns an array of exports "conditions" that is supported, or null if exports itself is not supported
  • node-exports-info/getRange: takes a category; returns the node semver version range that matches it
  • node-exports-info/getRangePairs: returns an array of entries - each a tuple of “semver range” and “category”
  • node-exports-info/isCategory: takes a category; returns true if its a known category

Tests

Simply clone the repo, npm install, and run npm test