{"library":"node-exports-info","title":"Node Exports Info","description":"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.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install node-exports-info"],"cli":null},"imports":["import getCategory from 'node-exports-info/getCategory';","import getCategoriesForRange from 'node-exports-info/getCategoriesForRange';","import getCategoryInfo from 'node-exports-info/getCategoryInfo';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import getCategory from 'node-exports-info/getCategory';\nimport getCategoryInfo from 'node-exports-info/getCategoryInfo';\nimport getRangePairs from 'node-exports-info/getRangePairs';\n\n// Get the exports category for the current Node.js version\nconst currentCategory = getCategory();\nconsole.log(`Current Node.js exports category: ${currentCategory}`);\n\n// Get detailed info for a specific category, e.g., 'patterns'\nconst patternInfo = getCategoryInfo('patterns');\nconsole.log('\\nInfo for 'patterns' category:');\nconsole.log(JSON.stringify(patternInfo, null, 2));\n\n// Get info for the current category, specifically for 'require' module system\nconst currentCategoryRequireInfo = getCategoryInfo(currentCategory, 'require');\nconsole.log(`\\nCurrent category ('${currentCategory}') flags for 'require':`);\nconsole.log(JSON.stringify(currentCategoryRequireInfo.flags, null, 2));\n\n// List all categories with their associated semver ranges\nconsole.log('\\nAll exports categories and their Node.js version ranges:');\ngetRangePairs().forEach(([range, category]) => {\n  console.log(`- ${category}: ${range}`);\n});","lang":"typescript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}