{"name":"@cspell/dynamic-import","version":"6.29.0","keywords":["module","esm","cjs","import","require"],"author":{"name":"Jason Dent","email":"jason@streetsidesoftware.nl"},"license":"MIT","_id":"@cspell/dynamic-import@6.29.0","homepage":"https://github.com/streetsidesoftware/cspell/tree/main/packages/dynamic-import#readme","bugs":{"url":"https://github.com/streetsidesoftware/cspell/labels/cspell-pipe"},"dist":{"shasum":"6b65606f0ecf5a53509c87482413b4e63d05e400","tarball":"http://registry-npm.ywwl.com/@cspell/dynamic-import/download/@cspell/dynamic-import-6.29.0.tgz","fileCount":11,"integrity":"sha512-4HO9h8kJ8r6nCFuXSi1Yb9BhRD6ga2ujv5RCi6HPjdqJBFwo2fVkb87x+rDjDesPg0ywKfIsmJdmsDcSzujxyQ==","signatures":[{"sig":"MEUCIFPkALz/HmE3qk/xVOis7VlD8TcNiA67t8Aj8LuK6DONAiEA95+xPbgeHqw0d3Yqrh+O/CqEg88P2INJYxX92nm9EXE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDGZxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrodw/9GR/mk4AlqMtziaFNFZ6ElsOrObmRanfnrJKTYD1H06+ctXWj\r\nLom+lA4WkmASnRk8fykAkU9OTMrIJ9U2KbrQlHMm0FBgzz9EnWzhKALechlw\r\nrGnBM+ZexRujrGUMBMg0BnsmW1O77bzEBxq7mEXzAg5033pezkgp6Mk7epJ2\r\n8FAyzbdjU3p7ZA4/SfkZLaf0++UHZr/WIwXqkuXNbXgo+4/Vmdsc6XH+k1RH\r\ndsX6KVCMKILpMnnRjWhlqEBJFTdLAg8slt5glabIEZ4OwpVbRz5g2aJJfAdA\r\nqVat15UQylHrE3lZaNvUH3j3lSi46OkbTZnSwIBT0K+rKlYXfEACABA3NLxB\r\nSeWWpRce+n8lQQbwWBYs3QPMSnw6O4mgKxDIfU/9Xo7NUfT9oki5Xbr4ebZt\r\ni2qap33biJE72V7LJNoqS8ab+rCjShwBE7jV5rAmGPGV3LOTglI7uggeYKZ3\r\n7REQh6wpes2J72HuwenoNHMrkwdmIKpoMKwGi/+PWnrMy8UFt8/kjcWqcw5P\r\ndFaVP/ZtUuJ1W595ZzRmAKTlZHHenIFzuf3ArRk46LC3Q8v9A0mD9r/P9b2n\r\nxcVUNakipuqbo9x/5fVAVx0zu8PW3VdlQW010dt5EfTTVDm58pEc9k6sJed6\r\nYvz2oJLyFrJPxH4nOZrpPGuKqHNtClwCVvk=\r\n=apLS\r\n-----END PGP SIGNATURE-----\r\n","size":3201,"noattachment":false,"key":"/@cspell/dynamic-import/-/@cspell/dynamic-import-6.29.0.tgz"},"main":"./dist/cjs/index.js","type":"commonjs","types":"./dist/cjs/index.d.ts","module":"./dist/esm/index.mjs","engines":{"node":">=14"},"exports":{".":{"import":"./dist/esm/index.mjs","require":"./dist/cjs/index.js"}},"gitHead":"2eabb1c47c12c2a42eb95d30329be6f544ee2ffc","scripts":{"test":"vitest run","build":"tsc -b .","watch":"tsc -b . --watch","coverage":"pnpm coverage:vitest && pnpm coverage:fix","test-watch":"vitest","build:clean":"shx rm -rf dist coverage && pnpm build","clean-build":"pnpm build:clean","coverage:fix":"nyc report --temp-dir \"$(pwd)/coverage\" --reporter lcov --report-dir \"$(pwd)/coverage\" --cwd ../..","coverage:vitest":"vitest run --coverage"},"_npmUser":{"name":"jason-dent","email":"jason@streetsidesoftware.nl"},"repository":{"url":"git+https://github.com/streetsidesoftware/cspell.git","type":"git"},"_npmVersion":"lerna/1.16.1/node@v18.14.2+x64 (linux)","description":"Dynamic Module Loader","directories":{},"_nodeVersion":"18.14.2","dependencies":{"import-meta-resolve":"^2.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/dynamic-import_6.29.0_1678534257604_0.18427930486995536","host":"s3://npm-registry-packages"},"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":1678534257834,"maintainers":[{"name":"jason-dent","email":"jason@streetsidesoftware.nl"}],"_cnpm_publish_time":1678534257834,"dist-tags":{"latest":"10.4.0","next":"10.4.0-alpha.1"}}