{"_id":"@cspell/dynamic-import@10.4.0","bugs":{"url":"https://github.com/streetsidesoftware/cspell/issues?q=is%3Aissue%20state%3Aopen%20label%3Adynamic-import"},"dist":{"shasum":"679908213021f2c197a6eaf67722b6bb49b223e0","tarball":"http://registry-npm.ywwl.com/@cspell/dynamic-import/download/@cspell/dynamic-import-10.4.0.tgz","fileCount":9,"integrity":"sha512-scSwtJDqpRT/Kqzo64XR8OWzXYfdpp9Yneq99Drhqm5gXXI2BAlgjzhBnMGKa+x7eIJZVM2+D2uFeDI2xQYM2w==","signatures":[{"sig":"MEQCIB/A1OIgdpK7fRM5NXRHm5xWqZyDokjfGtjBxbfiVEe3AiB5hMO2PqAomtwD3Qxu0B6PNvZEZ/EFIpfIT/0De/pjzg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEOjHG9FtX8ztzzB1bDcDjOQiczpSfa3SaRgkCvKOqVAAiEAyYkKihjlEZh3VsG53lIbjsHO/fDDrpAP5qynfoX0wNA="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cspell%2fdynamic-import@10.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":8310,"size":3290,"noattachment":false,"key":"/@cspell/dynamic-import/-/@cspell/dynamic-import-10.4.0.tgz"},"main":"./dist/cjs/index.js","name":"@cspell/dynamic-import","type":"commonjs","types":"./dist/cjs/index.d.ts","author":{"name":"Jason Dent","email":"jason@streetsidesoftware.nl"},"module":"./dist/esm/index.mjs","engines":{"node":">=22.18.0"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.js"}},"gitHead":"7e2bbb5e866c827ac5d2cf6b84bf3e1a016d0823","license":"MIT","scripts":{"test":"vitest run","build":"tsc -b . -f","clean":"shx rm -rf dist coverage","watch":"tsc -b . --watch -f","coverage":"vitest run --coverage","test-watch":"vitest","build:clean":"pnpm clean && pnpm build","clean-build":"pnpm build:clean"},"version":"10.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"1a46451c-a13b-4d24-bd2c-c3da381683f8"}},"homepage":"https://github.com/streetsidesoftware/cspell/tree/main/packages/dynamic-import#readme","keywords":["module","esm","cjs","import","require"],"repository":{"url":"git+https://github.com/streetsidesoftware/cspell.git","type":"git","directory":"packages/dynamic-import"},"_npmVersion":"lerna/5.6.2/node@v24.21.0+x64 (linux)","description":"Dynamic Module Loader","directories":{},"maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"sideEffects":false,"_nodeVersion":"24.21.0","dependencies":{"@cspell/url":"10.4.0","import-meta-resolve":"^4.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dynamic-import_10.4.0_1791970063082_0.8978779240525372"},"readme":"# `@cspell/dynamic-import`\n\nA small library to assist with dynamically loading CommonJS and ESM modules from either CommonJS or ESM modules.\n\n## Install\n\n```sh\nnpm install -S @cspell/dynamic-import\n```\n\n## Usage\n\n### Example ESM Package\n\nExample loading [chalk v5](https://www.npmjs.com/package/chalk), which is an ESM-only module.\n\n**TypeScript CommonJS**\n\n```ts\nimport { dynamicImport } from '@cspell/dynamic-import';\n\nconst pChalk = dynamicImport<typeof import('chalk')>('chalk', __dirname);\n```\n\n**TypeScript ESM**\n\n```ts\nimport { dynamicImport } from '@cspell/dynamic-import';\n\nconst pChalk = dynamicImport<typeof import('chalk')>('chalk', import.meta.url);\n```\n\n### Example ESM files\n\n**TypeScript CommonJS**\n\n```ts\nimport { dynamicImport } from '@cspell/dynamic-import';\n\nconst pIndex = dynamicImport<typeof import('../esm/index.mjs')>('../esm/index.mjs', __dirname);\n```\n\n<!--- @@inject: ../../static/footer.md --->\n\n<br/>\n\n---\n\n<p align=\"center\">Brought to you by<a href=\"https://streetsidesoftware.com\" title=\"Street Side Software\"><img width=\"16\" alt=\"Street Side Software Logo\" src=\"https://i.imgur.com/CyduuVY.png\" /> Street Side Software</a></p>\n\n<!--- @@inject-end: ../../static/footer.md --->\n\n<!--- cspell:dictionaries typescript --->\n","publish_time":1791970063168,"_cnpm_publish_time":1791970063168,"dist-tags":{"latest":"10.4.0","next":"10.4.0-alpha.1"}}