{"_id":"@8ctavio/resolve-module-export-names","_rev":"3-59955b3e50a547553d6ea876bc71a495","name":"@8ctavio/resolve-module-export-names","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@8ctavio/resolve-module-export-names","version":"0.0.1","author":{"url":"https://github.com/8ctavio","name":"Octavio Araiza"},"license":"MIT","_id":"@8ctavio/resolve-module-export-names@0.0.1","maintainers":[{"name":"8ctavio","email":"superintendent.code@gmail.com"}],"homepage":"https://github.com/8ctavio/resolve-module-export-names#readme","bugs":{"url":"https://github.com/8ctavio/resolve-module-export-names/issues"},"dist":{"shasum":"82a792fed7da0233eef14b6c266dcc8910b3af0c","tarball":"https://registry.npmjs.org/@8ctavio/resolve-module-export-names/-/resolve-module-export-names-0.0.1.tgz","fileCount":6,"integrity":"sha512-YlTDCFijKTPwJWrLRoomBuKOTBcfQ7r86ba+jagnUExIA1rEgAazy+4cHk0NR27vFueE8tIThtUGbSYkYFShAA==","signatures":[{"sig":"MEUCIQDQQaa0Xi2LwPGgd3ce9YgPX/crFPRbJBFmUo8xmW9zOQIgAdLhxKpm/1UVtjJLnZ8zg5ic6dPIguMu+KOmo4lER1g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8318},"type":"module","_from":"file:8ctavio-resolve-module-export-names-0.0.1.tgz","exports":{".":{"types":"./src/dist-dts/index.d.ts","import":"./src/index.js"}},"scripts":{"dts":"tsc -b ./tsconfig.lib.json","lint":"oxlint","test":"vitest run","typecheck":"tsc -p ./tsconfig.lib.json --noEmit"},"_npmUser":{"name":"8ctavio","email":"superintendent.code@gmail.com"},"_resolved":"C:\\Users\\odst8\\AppData\\Local\\Temp\\1042049f8dd346e51bc6056384d0496b\\8ctavio-resolve-module-export-names-0.0.1.tgz","_integrity":"sha512-YlTDCFijKTPwJWrLRoomBuKOTBcfQ7r86ba+jagnUExIA1rEgAazy+4cHk0NR27vFueE8tIThtUGbSYkYFShAA==","devEngines":{"runtime":[{"name":"node","onFail":"warn","version":"^22.17.1"}]},"repository":{"url":"git+https://github.com/8ctavio/resolve-module-export-names.git","type":"git"},"_npmVersion":"10.9.2","description":"Retrieve names of JavaScript modules' exported values","directories":{},"_nodeVersion":"22.17.1","dependencies":{"oxc-parser":"^0.87.0","oxc-resolver":"^11.6.0"},"_hasShrinkwrap":false,"devDependencies":{"oxlint":"1.14.0","vitest":"3.2.4","typescript":"5.9.2","@types/node":"24.3.1"},"_npmOperationalInternal":{"tmp":"tmp/resolve-module-export-names_0.0.1_1757359830259_0.9673718152590729","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@8ctavio/resolve-module-export-names","version":"0.0.2","author":{"url":"https://github.com/8ctavio","name":"Octavio Araiza"},"license":"MIT","_id":"@8ctavio/resolve-module-export-names@0.0.2","maintainers":[{"name":"8ctavio","email":"superintendent.code@gmail.com"}],"homepage":"https://github.com/8ctavio/resolve-module-export-names#readme","bugs":{"url":"https://github.com/8ctavio/resolve-module-export-names/issues"},"dist":{"shasum":"7fc83fd0b4f11a8fdf68832c9a690b675efc7756","tarball":"https://registry.npmjs.org/@8ctavio/resolve-module-export-names/-/resolve-module-export-names-0.0.2.tgz","fileCount":6,"integrity":"sha512-A+WtnONfjJG3KJxfz2mtYxUbxSLXCWwXbebRvC4Ag5z1FmPRUGJWtjsEdimvoRVlvn/lvef7AutFLZEG24B1PA==","signatures":[{"sig":"MEQCIGTBvQJVSyCxbY7juBVDe12lf3bryo4vnepmRhm7edznAiB5U6x1b3BmwiMqGdxnBFRaaqPxXEeje533BCctOwtJmw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10994},"type":"module","_from":"file:8ctavio-resolve-module-export-names-0.0.2.tgz","exports":{".":{"types":"./src/dist-dts/index.d.ts","import":"./src/index.js"}},"scripts":{"dts":"tsc -b ./tsconfig.lib.json","lint":"oxlint","test":"vitest run","typecheck":"tsc -p ./tsconfig.lib.json --noEmit"},"_npmUser":{"name":"8ctavio","email":"superintendent.code@gmail.com"},"_resolved":"C:\\Users\\odst8\\AppData\\Local\\Temp\\3ae564e4622321367e7ccaceb198274b\\8ctavio-resolve-module-export-names-0.0.2.tgz","_integrity":"sha512-A+WtnONfjJG3KJxfz2mtYxUbxSLXCWwXbebRvC4Ag5z1FmPRUGJWtjsEdimvoRVlvn/lvef7AutFLZEG24B1PA==","devEngines":{"runtime":[{"name":"node","onFail":"warn","version":"^22.17.1"}]},"repository":{"url":"git+https://github.com/8ctavio/resolve-module-export-names.git","type":"git"},"_npmVersion":"10.9.2","description":"Retrieve names of JavaScript modules' exported values","directories":{},"_nodeVersion":"22.17.1","dependencies":{"oxc-parser":"^0.87.0","oxc-resolver":"^11.6.0"},"_hasShrinkwrap":false,"devDependencies":{"oxlint":"1.19.0","vitest":"3.2.4","typescript":"5.9.3","@types/node":"24.6.2"},"_npmOperationalInternal":{"tmp":"tmp/resolve-module-export-names_0.0.2_1759455589186_0.8818580846181778","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@8ctavio/resolve-module-export-names","version":"0.0.3","license":"MIT","description":"Retrieve names of JavaScript modules' exported values","author":{"name":"Octavio Araiza","url":"https://github.com/8ctavio"},"repository":{"type":"git","url":"git+https://github.com/8ctavio/resolve-module-export-names.git"},"bugs":{"url":"https://github.com/8ctavio/resolve-module-export-names/issues"},"type":"module","exports":{".":{"types":{"dev":"./src/index.js","default":"./dts/index.d.ts"},"import":"./src/index.js"}},"dependencies":{"oxc-parser":"^0.87.0","oxc-resolver":"^11.6.0"},"devDependencies":{"@types/node":"24.6.2","oxlint":"1.19.0","typescript":"5.9.3","vitest":"3.2.4"},"devEngines":{"runtime":[{"name":"node","version":"^22.17.1","onFail":"warn"}]},"scripts":{"lint":"oxlint","dts":"tsc -p ./tsconfig.src.json","test":"vitest run","test:prod":"vitest run --typecheck.tsconfig ./tsconfig.tests.prod.json","typecheck":"pnpm typecheck:src && pnpm typecheck:tests","typecheck:src":"tsc -p ./tsconfig.src.json --noEmit","typecheck:tests":"tsc -p ./tsconfig.tests.json","typecheck:tests:prod":"tsc -p ./tsconfig.tests.json --customConditions null"},"_id":"@8ctavio/resolve-module-export-names@0.0.3","homepage":"https://github.com/8ctavio/resolve-module-export-names#readme","_integrity":"sha512-FLRe+xJKcG/1Fi6+FKn6q3l6Zy5g6relbg/lMp2jtzK2zFq539W/kaFujmvARDEJ66lQbpzgxEjUhAiOdL++sw==","_resolved":"C:\\Users\\odst8\\AppData\\Local\\Temp\\0e81f7dfa172f2a6d5039f0598dd4b0f\\8ctavio-resolve-module-export-names-0.0.3.tgz","_from":"file:8ctavio-resolve-module-export-names-0.0.3.tgz","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-FLRe+xJKcG/1Fi6+FKn6q3l6Zy5g6relbg/lMp2jtzK2zFq539W/kaFujmvARDEJ66lQbpzgxEjUhAiOdL++sw==","shasum":"e64fe1c4b86a99779f442bc916c3884d648d1b9b","tarball":"https://registry.npmjs.org/@8ctavio/resolve-module-export-names/-/resolve-module-export-names-0.0.3.tgz","fileCount":6,"unpackedSize":19733,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICST165MdVPrSSheVik2hXQEDNqNUfQil73aRqPQqYhcAiEAs5MXOYvsA8tfFKN2z3yo2cCfVftNUSF0y/6On5YQGb8="}]},"_npmUser":{"name":"8ctavio","email":"superintendent.code@gmail.com"},"directories":{},"maintainers":[{"name":"8ctavio","email":"superintendent.code@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/resolve-module-export-names_0.0.3_1760667619835_0.7568606341735837"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-08T19:30:30.138Z","modified":"2025-10-17T02:20:20.210Z","0.0.1":"2025-09-08T19:30:30.488Z","0.0.2":"2025-10-03T01:39:49.404Z","0.0.3":"2025-10-17T02:20:20.035Z"},"bugs":{"url":"https://github.com/8ctavio/resolve-module-export-names/issues"},"author":{"name":"Octavio Araiza","url":"https://github.com/8ctavio"},"license":"MIT","homepage":"https://github.com/8ctavio/resolve-module-export-names#readme","repository":{"type":"git","url":"git+https://github.com/8ctavio/resolve-module-export-names.git"},"description":"Retrieve names of JavaScript modules' exported values","maintainers":[{"name":"8ctavio","email":"superintendent.code@gmail.com"}],"readme":"### `resolveModuleExportNames`\r\n\r\n> Returns the names of ESM modules' exported values\r\n\r\n### Usage\r\n\r\n```js\r\nimport { resolveModuleExportNames } from '@8ctavio/export-module-export-names'\r\n\r\n// Resolve export names of module with a relative path\r\nconst exportNames = resolveModuleExportNames('./path/to/module.js', import.meta.dirname)\r\n\r\n// Resolve export names of a package\r\nconst exportNames = resolveModuleExportNames('pkg', import.meta.dirname)\r\nconst exportNames = resolveModuleExportNames('@scope/pkg', import.meta.dirname)\r\n\r\n// Retrieve result as a Set\r\nconst exportNames = resolveModuleExportNames(path, dir, { asSet: true })\r\n\r\n// Collect export names into external Set\r\nconst exportNames = new Set()\r\nresolveModuleExportNames('pkg-1', import.meta.dirname, { exportNames })\r\nresolveModuleExportNames('pkg-2', import.meta.dirname, { exportNames })\r\n\r\n// Omit reference directory if specifier is an absolute path\r\nconst modulePath = resolvePath('./path/to/module.js', import.meta.dirname)\r\nconst exportNames = resolveModuleExportNames(modulePath, {/* ... */})\r\n\r\n// Include type exports\r\nconst exportNames = resolveModuleExportNames('/path/to/declaration.d.ts', {\r\n\tincludeTypes: true\r\n})\r\n\r\n// Include type exports only\r\nconst exportNames = resolveModuleExportNames('/path/to/declaration.d.ts', {\r\n\tincludeTypes: 'only'\r\n})\r\n\r\n// Separate value and type export names\r\nconst [values, types] = resolveModuleExportNames('/path/to/declaration.d.ts', {\r\n\tincludeTypes: 'separate'\r\n})\r\n\r\n// Collect value and type export names into external Sets\r\nconst exportNames = [new Set(), new Set()]\r\nresolveModuleExportNames('/path/to/declaration.d.ts', {\r\n\tincludeTypes: 'separate',\r\n\texportNames\r\n})\r\n```\r\n\r\n### Definition\r\n\r\n```ts\r\nfunction resolveModuleExportNames(\r\n\tspecifier: string,\r\n\tdirectory: string,\r\n\toptions?: ResolveModuleExportNamesOptions\r\n): string[] | Set<string> | [string[], string[]] | [Set<string>, Set<string>]\r\nfunction resolveModuleExportNames(\r\n\tspecifier: string,\r\n\toptions?: ResolveModuleExportNamesOptions\r\n): string[] | Set<string> | [string[], string[]] | [Set<string>, Set<string>]\r\n\r\ntype ResolveModuleExportNamesOptions = {\r\n\tasSet?: boolean;\r\n\texportNames?: Set<string>;\r\n\tincludeTypes?: boolean | 'only' | 'separate'\r\n}\r\n```\r\n\r\n#### Parameters\r\n\r\n- `specifier`: Module specifier.\r\n- `directory`: Reference directory path from which the module `specifier` is resolved.\r\n- `options`:\r\n\t- `exportNames`: `Set` in which to add export names as they are found.\r\n\t- `asSet`: If set to `true` a `Set` is returned; an `Array` is returned otherwise. Defaults to `false` if `exportNames` is not provided, and to `true` otherwise.\r\n\t- `includeTypes`: Whether to retrieve type export names.\r\n\t\t- If set to `only`, only type exports are retrieved.\r\n\t\t- If set to `separate`, value and type export names are collected into different arrays/sets. An array that stores the value and type export name arrays/sets in that order is returned.\r\n\t\t\t\r\n\t\t\tDefaults to `false`.\r\n\t\t","readmeFilename":"README.md"}