{"name":"@cspell/dynamic-import","publishConfig":{"access":"public"},"version":"8.9.1","description":"Dynamic Module Loader","keywords":["module","esm","cjs","import","require"],"author":{"name":"Jason Dent","email":"jason@streetsidesoftware.nl"},"homepage":"https://github.com/streetsidesoftware/cspell/tree/main/packages/dynamic-import#readme","license":"MIT","type":"commonjs","sideEffects":false,"main":"./dist/cjs/index.js","module":"./dist/esm/index.mjs","types":"./dist/cjs/index.d.ts","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.mjs"}},"scripts":{"build":"tsc -b . -f","build:clean":"pnpm clean && pnpm build","clean":"shx rm -rf dist coverage","clean-build":"pnpm build:clean","coverage":"vitest run --coverage","test-watch":"vitest","test":"vitest run","watch":"tsc -b . --watch -f"},"repository":{"type":"git","url":"git+https://github.com/streetsidesoftware/cspell.git","directory":"packages/dynamic-import"},"bugs":{"url":"https://github.com/streetsidesoftware/cspell"},"engines":{"node":">=18.0"},"dependencies":{"import-meta-resolve":"^4.1.0"},"gitHead":"f532c77cca4bfae380293c586f02f377354c850b","_id":"@cspell/dynamic-import@8.9.1","_nodeVersion":"18.20.3","_npmVersion":"lerna/3.5.1/node@v18.20.3+x64 (linux)","dist":{"integrity":"sha512-ao4IDqQ8MyRqiB3NHA8R7ThRsuDLXdSCFm7Pvz8EqDnWaX3NAuClzgT3EoxJlw9pyyPQX3tW5Vg7ft3GSsBFUw==","shasum":"80977709589e8bc916dca07e81d88c458ac271e9","tarball":"http://registry-npm.ywwl.com/@cspell/dynamic-import/download/@cspell/dynamic-import-8.9.1.tgz","fileCount":9,"unpackedSize":8133,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDL6Wc159+d+v7foLk6Hh2+0aApvkcqSU6rAe0QMpZiyQIhAPNMcN+d7nUKn4NPOuvbPtbMTKrL9tV5+dwp7YGBggg4"}],"size":3207,"noattachment":false,"key":"/@cspell/dynamic-import/-/@cspell/dynamic-import-8.9.1.tgz"},"_npmUser":{"name":"jason-dent","email":"jason@streetsidesoftware.nl"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dynamic-import_8.9.1_1718892091301_0.6660628230541017"},"_hasShrinkwrap":false,"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 Common JS**\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 Common JS**\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":1718892091476,"maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"_cnpm_publish_time":1718892091476,"dist-tags":{"latest":"10.4.0","next":"10.4.0-alpha.1"}}