{"_id":"resolve.exports","_rev":"3774353","name":"resolve.exports","description":"A tiny (952b), correct, general-purpose, and configurable \"exports\" and \"imports\" resolver without file-system reliance","dist-tags":{"latest":"2.0.3","next":"2.0.0-next.0"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"time":{"modified":"2025-05-06T07:58:57.000Z","created":"2021-01-09T02:28:53.413Z","2.0.3":"2024-12-02T16:31:19.165Z","2.0.2":"2023-03-23T19:00:36.907Z","2.0.1":"2023-03-06T19:02:13.593Z","2.0.0":"2023-01-16T22:05:13.742Z","2.0.0-next.0":"2023-01-15T16:09:04.984Z","1.1.1":"2023-01-11T21:59:05.921Z","1.1.0":"2021-10-15T01:01:45.819Z","1.0.2":"2021-01-12T20:50:52.533Z","1.0.1":"2021-01-11T19:05:58.595Z","1.0.0":"2021-01-11T06:05:44.729Z","0.0.1":"2021-01-09T05:11:27.419Z","0.0.0":"2021-01-09T02:28:53.413Z"},"users":{},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"versions":{"2.0.3":{"version":"2.0.3","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (952b), correct, general-purpose, and configurable \"exports\" and \"imports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt -m","types":"tsc --noEmit","test":"uvu -r tsm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"next","tsm":"2.3.0","typescript":"4.9.4","uvu":"0.5.4"},"_id":"resolve.exports@2.0.3","gitHead":"6613167c0b4fc1511fc52171f4f52cb030c928c3","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"shasum":"41955e6f1b4013b7586f873749a635dea07ebe3f","size":7430,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-2.0.3.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_2.0.3_1733157078992_0.7238616381641907"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-12-02T16:31:19.165Z","publish_time":1733157079165,"_source_registry_name":"default","_cnpm_publish_time":1733157079165},"2.0.2":{"version":"2.0.2","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (952b), correct, general-purpose, and configurable \"exports\" and \"imports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt -m","types":"tsc --noEmit","test":"uvu -r tsm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"next","tsm":"2.3.0","typescript":"4.9.4","uvu":"0.5.4"},"gitHead":"ac545e5b1b0845c0cae9d5e728531db85becc3fa","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@2.0.2","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"shasum":"f8c934b8e6a13f539e38b7098e2e36134f01e800","size":7363,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-2.0.2.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_2.0.2_1679598036753_0.9606690151455957"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-23T19:00:36.907Z","publish_time":1679598036907,"_cnpm_publish_time":1679598036907},"2.0.1":{"version":"2.0.1","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (952b), correct, general-purpose, and configurable \"exports\" and \"imports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt -m","types":"tsc --noEmit","test":"uvu -r tsm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"next","tsm":"2.3.0","typescript":"4.9.4","uvu":"0.5.4"},"gitHead":"8f3fe0d48ed349520cdbc23352d20962a73f7b1b","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@2.0.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"shasum":"cee884cd4e3f355660e501fa3276b27d7ffe5a20","size":7365,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-2.0.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_2.0.1_1678129333393_0.3439290224473044"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-06T19:02:13.593Z","publish_time":1678129333593,"_cnpm_publish_time":1678129333593},"2.0.0":{"version":"2.0.0","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (952b), correct, general-purpose, and configurable \"exports\" and \"imports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt -m","types":"tsc --noEmit","test":"uvu -r tsm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"next","tsm":"2.3.0","typescript":"4.9.4","uvu":"0.5.4"},"gitHead":"d1b3468f9313decb3f025c7d884e0e8629aa31ba","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@2.0.0","_nodeVersion":"19.4.0","_npmVersion":"9.2.0","dist":{"shasum":"c1a0028c2d166ec2fbf7d0644584927e76e7400e","size":7351,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-2.0.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_2.0.0_1673906713573_0.5393012792194112"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-16T22:05:13.742Z","publish_time":1673906713742,"_cnpm_publish_time":1673906713742},"2.0.0-next.0":{"version":"2.0.0-next.0","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (987b), correct, general-purpose, and configurable \"exports\" and \"imports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt -m","types":"tsc --noEmit","test":"uvu -r tsm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"next","tsm":"2.3.0","typescript":"4.9.4","uvu":"0.5.4"},"readmeFilename":"readme.md","gitHead":"168ba52c4b0fa267cbae3e98fe0036f3d7b47a5c","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@2.0.0-next.0","_nodeVersion":"19.4.0","_npmVersion":"9.2.0","dist":{"shasum":"4f1b450e61bea15351ee2982bbc6967092ad8334","size":7432,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-2.0.0-next.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-2.0.0-next.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_2.0.0-next.0_1673798944798_0.8447938544221767"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-15T16:09:04.984Z","publish_time":1673798944984,"_cnpm_publish_time":1673798944984},"1.1.1":{"version":"1.1.1","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (813b), correct, general-purpose, and configurable \"exports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"dc499dcd5ad6b237913a4c7e26f5f68707f0a9b6","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@1.1.1","_nodeVersion":"19.4.0","_npmVersion":"9.2.0","dist":{"shasum":"05cfd5b3edf641571fd46fa608b610dda9ead999","size":6142,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-1.1.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_1.1.1_1673474345729_0.15163516585965664"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-11T21:59:05.921Z","publish_time":1673474345921,"_cnpm_publish_time":1673474345921},"1.1.0":{"version":"1.1.0","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (737b), correct, general-purpose, and configurable \"exports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"6d29cfbabfea13a41cbb75b57bdf46f6b0bb5115","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@1.1.0","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"shasum":"5ce842b94b05146c0e03076985d1d0e7e48c90c9","size":5946,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-1.1.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_1.1.0_1634259705622_0.15236758173837206"},"_hasShrinkwrap":false,"publish_time":1634259705819,"_cnpm_publish_time":1634259705819},"1.0.2":{"version":"1.0.2","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (727b), correct, general-purpose, and configurable \"exports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"c6814c43cb27ee6092f649be3fdf6c1fb55c51e4","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@1.0.2","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"shasum":"98c82ba8a4d3f9fcc32cbfa6f950b803d77b6c21","size":5654,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-1.0.2.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_1.0.2_1610484652362_0.17950109833312755"},"_hasShrinkwrap":false,"publish_time":1610484652533,"_cnpm_publish_time":1610484652533},"1.0.1":{"version":"1.0.1","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (727b), correct, general-purpose, and configurable \"exports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"bd8eacfbf1144ad7334d8414ce9f5573c91a07d0","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@1.0.1","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"shasum":"9aff14e2ed43ea40bbdc2f83b9a2465b1f093325","size":5654,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-1.0.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_1.0.1_1610391958457_0.13014374403190643"},"_hasShrinkwrap":false,"publish_time":1610391958595,"_cnpm_publish_time":1610391958595},"1.0.0":{"version":"1.0.0","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"A tiny (710b), correct, general-purpose, and configurable \"exports\" resolver without file-system reliance","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":["esm","exports","esmodules","fields","modules","resolution","resolve"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"c81235c81ad786fa5d71cebbab099ae4609b3265","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@1.0.0","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"shasum":"47cea79065a93169e1efa02310c92736dcdc849d","size":5621,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-1.0.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_1.0.0_1610345144538_0.23640678369926849"},"_hasShrinkwrap":false,"publish_time":1610345144729,"_cnpm_publish_time":1610345144729},"0.0.1":{"version":"0.0.1","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"WIP","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt","pretest":"npm run build","test":"uvu -r esm test"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":[],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"f490b473abe6937ef582f9c620f77fe2ac69d9e1","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@0.0.1","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"shasum":"75ed520cbe5e4507eebe5f788d63d112745382aa","size":2615,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-0.0.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_0.0.1_1610169087255_0.6282237017307519"},"_hasShrinkwrap":false,"publish_time":1610169087419,"_cnpm_publish_time":1610169087419},"0.0.0":{"version":"0.0.0","name":"resolve.exports","repository":{"type":"git","url":"git+https://github.com/lukeed/resolve.exports.git"},"description":"WIP","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=10"},"scripts":{"build":"bundt","pretest":"npm run build","test":"uvu -r esm test"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"keywords":[],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"32dc6ab123ef15ed096441644b8faa66b6198f86","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"homepage":"https://github.com/lukeed/resolve.exports#readme","_id":"resolve.exports@0.0.0","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"shasum":"b27cafe187230c06a262ef0c1bc5c367df208e55","size":2438,"noattachment":false,"key":"/resolve.exports/-/resolve.exports-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/resolve.exports/download/resolve.exports-0.0.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resolve.exports_0.0.0_1610159333296_0.8788517243813143"},"_hasShrinkwrap":false,"publish_time":1610159333413,"_cnpm_publish_time":1610159333413}},"readme":"# resolve.exports [![CI](https://github.com/lukeed/resolve.exports/workflows/CI/badge.svg)](https://github.com/lukeed/resolve.exports/actions) [![licenses](https://licenses.dev/b/npm/resolve.exports)](https://licenses.dev/npm/resolve.exports) [![codecov](https://codecov.io/gh/lukeed/resolve.exports/branch/master/graph/badge.svg?token=4P7d4Omw2h)](https://codecov.io/gh/lukeed/resolve.exports)\n\n> A tiny (952b), correct, general-purpose, and configurable `\"exports\"` and `\"imports\"` resolver without file-system reliance\n\n***Why?***\n\nHopefully, this module may serve as a reference point (and/or be used directly) so that the varying tools and bundlers within the ecosystem can share a common approach with one another **as well as** with the native Node.js implementation.\n\nWith the push for ESM, we must be _very_ careful and avoid fragmentation. If we, as a community, begin propagating different _dialects_ of the resolution algorithm, then we're headed for deep trouble. It will make supporting (and using) `\"exports\"` nearly impossible, which may force its abandonment and along with it, its benefits.\n\nLet's have nice things.\n\n## Install\n\n```sh\n$ npm install resolve.exports\n```\n\n## Usage\n\n> Please see [`/test/`](/test) for examples.\n\n```js\nimport * as resolve from 'resolve.exports';\n\n// package.json contents\nconst pkg = {\n  \"name\": \"foobar\",\n  \"module\": \"dist/module.mjs\",\n  \"main\": \"dist/require.js\",\n  \"imports\": {\n    \"#hash\": {\n      \"import\": {\n        \"browser\": \"./hash/web.mjs\",\n        \"node\": \"./hash/node.mjs\",\n      },\n      \"default\": \"./hash/detect.js\"\n    }\n  },\n  \"exports\": {\n    \".\": {\n      \"import\": \"./dist/module.mjs\",\n      \"require\": \"./dist/require.js\"\n    },\n    \"./lite\": {\n      \"worker\": {\n        \"browser\": \"./lite/worker.browser.js\",\n        \"node\": \"./lite/worker.node.js\"\n      },\n      \"import\": \"./lite/module.mjs\",\n      \"require\": \"./lite/require.js\"\n    }\n  }\n};\n\n// ---\n// Exports\n// ---\n\n// entry: \"foobar\" === \".\" === default\n// conditions: [\"default\", \"import\", \"node\"]\nresolve.exports(pkg);\nresolve.exports(pkg, '.');\nresolve.exports(pkg, 'foobar');\n//=> [\"./dist/module.mjs\"]\n\n// entry: \"foobar/lite\" === \"./lite\"\n// conditions: [\"default\", \"import\", \"node\"]\nresolve.exports(pkg, 'foobar/lite');\nresolve.exports(pkg, './lite');\n//=> [\"./lite/module.mjs\"]\n\n// Enable `require` condition\n// conditions: [\"default\", \"require\", \"node\"]\nresolve.exports(pkg, 'foobar', { require: true }); //=> [\"./dist/require.js\"]\nresolve.exports(pkg, './lite', { require: true }); //=> [\"./lite/require.js\"]\n\n// Throws \"Missing <entry> specifier in <name> package\" Error\nresolve.exports(pkg, 'foobar/hello');\nresolve.exports(pkg, './hello/world');\n\n// Add custom condition(s)\n// conditions: [\"default\", \"worker\", \"import\", \"node\"]\nresolve.exports(pkg, 'foobar/lite', {\n  conditions: ['worker']\n}); //=> [\"./lite/worker.node.js\"]\n\n// Toggle \"browser\" condition\n// conditions: [\"default\", \"worker\", \"import\", \"browser\"]\nresolve.exports(pkg, 'foobar/lite', {\n  conditions: ['worker'],\n  browser: true\n}); //=> [\"./lite/worker.browser.js\"]\n\n// Disable non-\"default\" condition activate\n// NOTE: breaks from Node.js default behavior\n// conditions: [\"default\", \"custom\"]\nresolve.exports(pkg, 'foobar/lite', {\n  conditions: ['custom'],\n  unsafe: true,\n});\n//=> Error: No known conditions for \"./lite\" specifier in \"foobar\" package\n\n// ---\n// Imports\n// ---\n\n// conditions: [\"default\", \"import\", \"node\"]\nresolve.imports(pkg, '#hash');\nresolve.imports(pkg, 'foobar/#hash');\n//=> [\"./hash/node.mjs\"]\n\n// conditions: [\"default\", \"import\", \"browser\"]\nresolve.imports(pkg, '#hash', { browser: true });\nresolve.imports(pkg, 'foobar/#hash');\n//=> [\"./hash/web.mjs\"]\n\n// conditions: [\"default\"]\nresolve.imports(pkg, '#hash', { unsafe: true });\nresolve.imports(pkg, 'foobar/#hash');\n//=> [\"./hash/detect.mjs\"]\n\nresolve.imports(pkg, '#hello/world');\nresolve.imports(pkg, 'foobar/#hello/world');\n//=> Error: Missing \"#hello/world\" specifier in \"foobar\" package\n\n// ---\n// Legacy\n// ---\n\n// prefer \"module\" > \"main\" (default)\nresolve.legacy(pkg); //=> \"dist/module.mjs\"\n\n// customize fields order\nresolve.legacy(pkg, {\n  fields: ['main', 'module']\n}); //=> \"dist/require.js\"\n```\n\n## API\n\nThe [`resolve()`](#resolvepkg-entry-options), [`exports()`](#exportspkg-entry-options), and [`imports()`](#importspkg-target-options) functions share similar API signatures:\n\n```ts\nexport function resolve(pkg: Package, entry?: string, options?: Options): string[] | undefined;\nexport function exports(pkg: Package, entry?: string, options?: Options): string[] | undefined;\nexport function imports(pkg: Package, target: string, options?: Options): string[] | undefined;\n//                                         ^ not optional!\n```\n\nAll three:\n* accept a `package.json` file's contents as a JSON object\n* accept a target/entry identifier\n* may accept an [Options](#options) object\n* return `string[]`, `string`, or `undefined`\n\nThe only difference is that `imports()` must accept a target identifier as there can be no inferred default.\n\nSee below for further API descriptions.\n\n> **Note:** There is also a [Legacy Resolver API](#legacy-resolver)\n\n---\n\n### resolve(pkg, entry?, options?)\nReturns: `string[]` or `undefined`\n\nA convenience helper which automatically reroutes to [`exports()`](#exportspkg-entry-options) or [`imports()`](#importspkg-target-options) depending on the `entry` value.\n\nWhen unspecified, `entry` defaults to the `\".\"` identifier, which means that `exports()` will be invoked.\n\n```js\nimport * as r from 'resolve.exports';\n\nlet pkg = {\n  name: 'foobar',\n  // ...\n};\n\nr.resolve(pkg);\n//~> r.exports(pkg, '.');\n\nr.resolve(pkg, 'foobar');\n//~> r.exports(pkg, '.');\n\nr.resolve(pkg, 'foobar/subpath');\n//~> r.exports(pkg, './subpath');\n\nr.resolve(pkg, '#hash/md5');\n//~> r.imports(pkg, '#hash/md5');\n\nr.resolve(pkg, 'foobar/#hash/md5');\n//~> r.imports(pkg, '#hash/md5');\n```\n\n### exports(pkg, entry?, options?)\nReturns: `string[]` or `undefined`\n\nTraverse the `\"exports\"` within the contents of a `package.json` file. <br>\nIf the contents _does not_ contain an `\"exports\"` map, then `undefined` will be returned.\n\nSuccessful resolutions will always result in a `string` or `string[]` value. This will be the value of the resolved mapping itself – which means that the output is a relative file path.\n\nThis function may throw an Error if:\n\n* the requested `entry` cannot be resolved (aka, not defined in the `\"exports\"` map)\n* an `entry` _is_ defined but no known conditions were matched (see [`options.conditions`](#optionsconditions))\n\n#### pkg\nType: `object` <br>\nRequired: `true`\n\nThe `package.json` contents.\n\n#### entry\nType: `string` <br>\nRequired: `false` <br>\nDefault: `.` (aka, root)\n\nThe desired target entry, or the original `import` path.\n\nWhen `entry` _is not_ a relative path (aka, does not start with `'.'`), then `entry` is given the `'./'` prefix.\n\nWhen `entry` begins with the package name (determined via the `pkg.name` value), then `entry` is truncated and made relative.\n\nWhen `entry` is already relative, it is accepted as is.\n\n***Examples***\n\nAssume we have a module named \"foobar\" and whose `pkg` contains `\"name\": \"foobar\"`.\n\n| `entry` value | treated as | reason |\n|-|-|-|\n| `null` / `undefined` | `'.'` | default |\n| `'.'` | `'.'` | value was relative |\n| `'foobar'` | `'.'` | value was `pkg.name` |\n| `'foobar/lite'` | `'./lite'` | value had `pkg.name` prefix |\n| `'./lite'` | `'./lite'` | value was relative |\n| `'lite'` | `'./lite'` | value was not relative & did not have `pkg.name` prefix |\n\n\n### imports(pkg, target, options?)\nReturns: `string[]` or `undefined`\n\nTraverse the `\"imports\"` within the contents of a `package.json` file. <br>\nIf the contents _does not_ contain an `\"imports\"` map, then `undefined` will be returned.\n\nSuccessful resolutions will always result in a `string` or `string[]` value. This will be the value of the resolved mapping itself – which means that the output is a relative file path.\n\nThis function may throw an Error if:\n\n* the requested `target` cannot be resolved (aka, not defined in the `\"imports\"` map)\n* an `target` _is_ defined but no known conditions were matched (see [`options.conditions`](#optionsconditions))\n\n#### pkg\nType: `object` <br>\nRequired: `true`\n\nThe `package.json` contents.\n\n#### target\nType: `string` <br>\nRequired: `true`\n\nThe target import identifier; for example, `#hash` or `#hash/md5`.\n\nImport specifiers _must_ begin with the `#` character, as required by the resolution specification. However, if `target` begins with the package name (determined by the `pkg.name` value), then `resolve.exports` will trim it from the `target` identifier. For example, `\"foobar/#hash/md5\"` will be treated as `\"#hash/md5\"` for the `\"foobar\"` package.\n\n## Options\n\nThe [`resolve()`](#resolvepkg-entry-options), [`imports()`](#importspkg-target-options), and [`exports()`](#exportspkg-entry-options) functions share these options. All properties are optional and you are not required to pass an `options` argument.\n\nCollectively, the `options` are used to assemble a list of [conditions](https://nodejs.org/docs/latest-v18.x/api/packages.html#conditional-exports) that should be activated while resolving your target(s).\n\n> **Note:** Although the Node.js documentation primarily showcases conditions alongside `\"exports\"` usage, they also apply to `\"imports\"` maps too. _([example](https://nodejs.org/docs/latest-v18.x/api/packages.html#subpath-imports))_\n\n#### options.require\nType: `boolean` <br>\nDefault: `false`\n\nWhen truthy, the `\"require\"` field is added to the list of allowed/known conditions. <br>\nOtherwise the `\"import\"` field is added instead.\n\n#### options.browser\nType: `boolean` <br>\nDefault: `false`\n\nWhen truthy, the `\"browser\"` field is added to the list of allowed/known conditions. <br>\nOtherwise the `\"node\"` field is added instead.\n\n#### options.conditions\nType: `string[]` <br>\nDefault: `[]`\n\nA list of additional/custom conditions that should be accepted when seen.\n\n> **Important:** The order specified within `options.conditions` does not matter. <br>The matching order/priority is **always** determined by the `\"exports\"` map's key order.\n\nFor example, you may choose to accept a `\"production\"` condition in certain environments. Given the following `pkg` content:\n\n```js\nconst pkg = {\n  // package.json ...\n  \"exports\": {\n    \"worker\": \"./$worker.js\",\n    \"require\": \"./$require.js\",\n    \"production\": \"./$production.js\",\n    \"import\": \"./$import.mjs\",\n  }\n};\n\nresolve.exports(pkg, '.');\n// Conditions: [\"default\", \"import\", \"node\"]\n//=> [\"./$import.mjs\"]\n\nresolve.exports(pkg, '.', {\n  conditions: ['production']\n});\n// Conditions: [\"default\", \"production\", \"import\", \"node\"]\n//=> [\"./$production.js\"]\n\nresolve.exports(pkg, '.', {\n  conditions: ['production'],\n  require: true,\n});\n// Conditions: [\"default\", \"production\", \"require\", \"node\"]\n//=> [\"./$require.js\"]\n\nresolve.exports(pkg, '.', {\n  conditions: ['production', 'worker'],\n  require: true,\n});\n// Conditions: [\"default\", \"production\", \"worker\", \"require\", \"node\"]\n//=> [\"./$worker.js\"]\n\nresolve.exports(pkg, '.', {\n  conditions: ['production', 'worker']\n});\n// Conditions: [\"default\", \"production\", \"worker\", \"import\", \"node\"]\n//=> [\"./$worker.js\"]\n```\n\n#### options.unsafe\nType: `boolean` <br>\nDefault: `false`\n\n> **Important:** You probably do not want this option! <br>It will break out of Node's default resolution conditions.\n\nWhen enabled, this option will ignore **all other options** except [`options.conditions`](#optionsconditions). This is because, when enabled, `options.unsafe` **does not** assume or provide any default conditions except the `\"default\"` condition.\n\n```js\nresolve.exports(pkg, '.');\n//=> Conditions: [\"default\", \"import\", \"node\"]\n\nresolve.exports(pkg, '.', { unsafe: true });\n//=> Conditions: [\"default\"]\n\nresolve.exports(pkg, '.', { unsafe: true, require: true, browser: true });\n//=> Conditions: [\"default\"]\n```\n\nIn other words, this means that trying to use `options.require` or `options.browser` alongside `options.unsafe` will have no effect. In order to enable these conditions, you must provide them manually into the `options.conditions` list:\n\n```js\nresolve.exports(pkg, '.', {\n  unsafe: true,\n  conditions: [\"require\"]\n});\n//=> Conditions: [\"default\", \"require\"]\n\nresolve.exports(pkg, '.', {\n  unsafe: true,\n  conditions: [\"browser\", \"require\", \"custom123\"]\n});\n//=> Conditions: [\"default\", \"browser\", \"require\", \"custom123\"]\n```\n\n## Legacy Resolver\n\nAlso included is a \"legacy\" method for resolving non-`\"exports\"` package fields. This may be used as a fallback method when for when no `\"exports\"` mapping is defined. In other words, it's completely optional (and tree-shakeable).\n\n### legacy(pkg, options?)\nReturns: `string` or `undefined`\n\nYou may customize the field priority via [`options.fields`](#optionsfields).\n\nWhen a field is found, its value is returned _as written_. <br>\nWhen no fields were found, `undefined` is returned. If you wish to mimic Node.js behavior, you can assume this means `'index.js'` – but this module does not make that assumption for you.\n\n#### options.browser\nType: `boolean` or `string` <br>\nDefault: `false`\n\nWhen truthy, ensures that the `'browser'` field is part of the acceptable `fields` list.\n\n> **Important:** If your custom [`options.fields`](#optionsfields) value includes `'browser'`, then _your_ order is respected. <br>Otherwise, when truthy, `options.browser` will move `'browser'` to the front of the list, making it the top priority.\n\nWhen `true` and `\"browser\"` is an object, then `legacy()` will return the the entire `\"browser\"` object.\n\nYou may also pass a string value, which will be treated as an import/file path. When this is the case and `\"browser\"` is an object, then `legacy()` may return:\n\n* `false` – if the package author decided a file should be ignored; or\n* your `options.browser` string value – but made relative, if not already\n\n> See the [`\"browser\" field specification](https://github.com/defunctzombie/package-browser-field-spec) for more information.\n\n#### options.fields\nType: `string[]` <br>\nDefault: `['module', 'main']`\n\nA list of fields to accept. The order of the array determines the priority/importance of each field, with the most important fields at the beginning of the list.\n\nBy default, the `legacy()` method will accept any `\"module\"` and/or \"main\" fields if they are defined. However, if both fields are defined, then \"module\" will be returned.\n\n```js\nimport { legacy } from 'resolve.exports';\n\n// package.json\nconst pkg = {\n  \"name\": \"...\",\n  \"worker\": \"worker.js\",\n  \"module\": \"module.mjs\",\n  \"browser\": \"browser.js\",\n  \"main\": \"main.js\",\n};\n\nlegacy(pkg);\n// fields = [module, main]\n//=> \"module.mjs\"\n\nlegacy(pkg, { browser: true });\n// fields = [browser, module, main]\n//=> \"browser.mjs\"\n\nlegacy(pkg, {\n  fields: ['missing', 'worker', 'module', 'main']\n});\n// fields = [missing, worker, module, main]\n//=> \"worker.js\"\n\nlegacy(pkg, {\n  fields: ['missing', 'worker', 'module', 'main'],\n  browser: true,\n});\n// fields = [browser, missing, worker, module, main]\n//=> \"browser.js\"\n\nlegacy(pkg, {\n  fields: ['module', 'browser', 'main'],\n  browser: true,\n});\n// fields = [module, browser, main]\n//=> \"module.mjs\"\n```\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","_attachments":{},"homepage":"https://github.com/lukeed/resolve.exports#readme","bugs":{"url":"https://github.com/lukeed/resolve.exports/issues"},"license":"MIT"}