{"name":"@loaderkit/resolve","type":"module","version":"1.0.6","exports":{"./*":"./dist/*.js"},"dependencies":{"@braidai/lang":"^1.0.0"},"repository":{"type":"git","url":"git+https://github.com/laverdet/loaderkit.git"},"author":{"name":"https://github.com/laverdet/"},"license":"ISC","homepage":"https://github.com/laverdet/loaderkit/blob/main/packages/resolve/README.md","scripts":{"clean":"rm -rf dist","test":"node --enable-source-maps --test-reporter=spec --test 'dist/__tests__/**/*.js'"},"_id":"@loaderkit/resolve@1.0.6","description":"[![npm version](https://badgen.now.sh/npm/v/@loaderkit/resolve)](https://www.npmjs.com/package/@loaderkit/resolve) [![isc license](https://badgen.now.sh/npm/license/@loaderkit/resolve)](https://github.com/braidnetworks/loaderkit/blob/main/LICENSE) [![gith","bugs":{"url":"https://github.com/laverdet/loaderkit/issues"},"_integrity":"sha512-G8FdIoF5CypfwmD9rl8BXod5HDn8JqB0CCNBXDTaRZ+yRYhARrrSToX1zg1zy9jX3zLqigsELwhT4gNtkdQAUg==","_resolved":"/tmp/6868e5eb130392956939aba69b2cc1cf/loaderkit-resolve-1.0.6.tgz","_from":"file:loaderkit-resolve-1.0.6.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-G8FdIoF5CypfwmD9rl8BXod5HDn8JqB0CCNBXDTaRZ+yRYhARrrSToX1zg1zy9jX3zLqigsELwhT4gNtkdQAUg==","shasum":"8d45341e688faecc25b3ae919c0f45d94c4e26c9","tarball":"http://registry-npm.ywwl.com/@loaderkit/resolve/download/@loaderkit/resolve-1.0.6.tgz","fileCount":23,"unpackedSize":105880,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@loaderkit%2fresolve@1.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBLAKJjD6teWIaD+EEp3u9M7kkaZ4XWF1SR2laOqEsFgAiAibi132PFnINtmaI/YSxpPOo8rDDTlgm90mI/voFfERQ=="}],"size":22849,"noattachment":false,"key":"/@loaderkit/resolve/-/@loaderkit/resolve-1.0.6.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2655c5f5-0e1d-40bd-b497-b3198c441bc5"}},"directories":{},"maintainers":[{"name":"laverdet","email":"marcel.npm@laverdet.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/resolve_1.0.6_1779078388345_0.354653631152652"},"_hasShrinkwrap":false,"readme":"[![npm version](https://badgen.now.sh/npm/v/@loaderkit/resolve)](https://www.npmjs.com/package/@loaderkit/resolve)\n[![isc license](https://badgen.now.sh/npm/license/@loaderkit/resolve)](https://github.com/braidnetworks/loaderkit/blob/main/LICENSE)\n[![github action](https://github.com/braidnetworks/loaderkit/actions/workflows/build.yaml/badge.svg)](https://github.com/braidnetworks/loaderkit/actions/workflows/build.yaml)\n[![npm downloads](https://badgen.now.sh/npm/dm/@loaderkit/resolve)](https://www.npmjs.com/package/@loaderkit/resolve)\n\n🔎 @loaderkit/resolve - General purpose nodejs module resolver\n==============================================================\n\nAn accurate & abstract implementation of the nodejs module resolution algorithms. It implements both\nthe [CommonJS](https://nodejs.org/api/modules.html#all-together) and\n[modules](https://nodejs.org/api/esm.html#resolution-and-loading-algorithm) algorithms. Originally\nauthored for [arethetypeswrong](https://arethetypeswrong.github.io).\n\nSee also: [resolve](https://www.npmjs.com/package/resolve),\n[enhanced-resolve](https://github.com/webpack/enhanced-resolve), and\n[esm-resolve](https://www.npmjs.com/package/esm-resolve). The main point of this package is accuracy\nwith the default nodejs resolution algorithms.\n\n- **Does nothing that the nodejs default resolver doesn't do**\n- Runs in a web browser w/ abstract filesystems\n- Sensible TypeScript-first types\n- Shakeable ESM exports\n- Promise & synchronous implementations\n\n## Usage\n```ts\nimport { resolve, resolveSync } from '@loaderkit/resolve/esm';\nimport { resolve as resolveRequire, resolveSync as resolveRequireSync } from '@loaderkit/resolve/cjs';\nimport { defaultAsyncFileSystem, defaultSyncFileSystem } from '@loaderkit/resolve/fs';\n\n// Async module resolution\nconst resolution = await resolve(defaultAsyncFileSystem, 'react', new URL(import.meta.url));\nconsole.log(resolution.format, resolution.url);\n// format: \"addon\" | \"builtin\" | \"commonjs\" | \"json\" | \"module\" | \"wasm\"\n// url: typeof URL\n\n// Synchronous module resolution\nresolveSync(defaultSyncFileSystem, 'react', new URL(import.meta.url));\n\n// CommonJS module resolution\nawait resolveRequire(defaultAsyncFileSystem, 'lodash', new URL(import.meta.url));\nresolveRequireSync(defaultSyncFileSystem, 'lodash', new URL(import.meta.url));\n```\n\nThe `FileSystemAsync` and `FileSystemSync` interfaces can be implemented by client code as\nnecessary. For example, you could write a delegate to load the module source files from a zip file,\nfrom the internet, or whatever you want.\n","publish_time":1779078388529,"_cnpm_publish_time":1779078388529,"dist-tags":{"latest":"1.0.6"}}