node-exports-info is a utility library providing programmatic access to detailed information about Node.js's `exports` field support across different Node.js versions. It helps developers understand which `exports` features, such as conditions, patterns, and pattern trailers, are available in specific Node.js environments. The library categorizes Node.js versions into distinct groups based on their `exports` implementation, including 'pre-exports', 'broken', 'experimental', 'conditions', and various pattern-related categories. This is crucial for authors of libraries and applications needing to ensure correct module resolution and interoperability across a wide range of Node.js versions, particularly given the evolving landscape of ESM and CJS module systems. Currently at version 1.6.0, it is actively maintained with updates likely correlating to significant changes in Node.js's module resolution behavior. Its primary differentiator is providing a comprehensive and version-specific mapping of `exports` capabilities, simplifying compatibility concerns for complex `package.json` `exports` configurations.
npm install node-exports-infoVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to identify the current Node.js exports category, retrieve detailed feature flags for specific categories or module systems, and list all known categories with their corresponding Node.js version ranges.
Consult the official Node.js documentation for `package.json` `exports` alongside this library's output to fully understand complex scenarios. Use the `getCategoryInfo` and `getCategoryFlags` functions to programmatically check for specific feature support.
Always use the full subpath for each function as listed in the 'Entry points' section of the documentation. Example: `import getCategory from 'node-exports-info/getCategory';`
Change the import statement to target the specific subpath for the desired function using a default import, e.g., `import getCategory from 'node-exports-info/getCategory';`
Verify that the import statement correctly uses the `default` import syntax for the specific subpath of the function you intend to use. For example, `import getCategoryInfo from 'node-exports-info/getCategoryInfo';`