{"name":"import-without-cache","version":"0.2.3","author":{"name":"Kevin Deng","email":"sxzz@sxzz.moe"},"license":"MIT","_id":"import-without-cache@0.2.3","maintainers":[{"name":"sxzz","email":"sxzz@sxzz.moe"}],"homepage":"https://github.com/sxzz/import-without-cache#readme","bugs":{"url":"https://github.com/sxzz/import-without-cache/issues"},"dist":{"shasum":"04016fc33220466843cb471ccd0e45cf82a5eb8d","tarball":"http://registry-npm.ywwl.com/import-without-cache/download/import-without-cache-0.2.3.tgz","fileCount":5,"integrity":"sha512-roCvX171VqJ7+7pQt1kSRfwaJvFAC2zhThJWXal1rN8EqzPS3iapkAoNpHh4lM8Na1BDen+n9rVfo73RN+Y87g==","signatures":[{"sig":"MEUCIQDfX2Inlo1Gik+7/G0+qaPEL0ePnnocp/j4Gx+oAyCcTwIgEuB1YZqilV8Z7zfTAE8kkSpPMO3Pr3ID2djPKSk74Fc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/import-without-cache@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":7037,"size":3122,"noattachment":false,"key":"/import-without-cache/-/import-without-cache-0.2.3.tgz"},"main":"./dist/index.mjs","type":"module","_from":"file:import-without-cache-0.2.3.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","engines":{"node":">=20.19.0"},"exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"funding":"https://github.com/sponsors/sxzz","scripts":{"dev":"tsdown --watch","lint":"eslint --cache .","test":"node --test tests/index.test.js","build":"tsdown","format":"prettier --cache --write .","release":"bumpp","lint:fix":"pnpm run lint --fix","test:bun":"bun test tests/bun.test.ts","typecheck":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c718c4c3-0299-4a8a-bdc3-447e153ecb43"}},"prettier":"@sxzz/prettier-config","_resolved":"/tmp/302a67b47fa448d7ed2dd3965a1cb1c2/import-without-cache-0.2.3.tgz","_integrity":"sha512-roCvX171VqJ7+7pQt1kSRfwaJvFAC2zhThJWXal1rN8EqzPS3iapkAoNpHh4lM8Na1BDen+n9rVfo73RN+Y87g==","repository":{"url":"git+https://github.com/sxzz/import-without-cache.git","type":"git"},"_npmVersion":"11.6.2","description":"Import ES modules without cache.","directories":{},"_nodeVersion":"24.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"bumpp":"^10.3.2","eslint":"^9.39.1","tsdown":"^0.17.2","prettier":"^3.7.4","@types/bun":"^1.3.4","typescript":"^5.9.3","@types/node":"^24.10.1","@sxzz/eslint-config":"^7.4.1","@sxzz/prettier-config":"^2.2.6","@typescript/native-preview":"7.0.0-dev.20251210.1"},"_npmOperationalInternal":{"tmp":"tmp/import-without-cache_0.2.3_1765391913145_0.5795118073153569","host":"s3://npm-registry-packages-npm-production"},"readme":"# import-without-cache\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Unit Test][unit-test-src]][unit-test-href]\n\nImport ES modules without cache.\n\n## Features\n\n- Import ES modules without cache\n- All dependencies are also imported without cache\n\n## Install\n\n```bash\nnpm i import-without-cache\n```\n\n## Usage\n\n```ts\nimport { clearRequireCache, init, isSupported } from 'import-without-cache'\n\nif (!isSupported) {\n  throw new Error('import-without-cache is not supported in this environment.')\n}\n\nconst deregister = init({\n  // Optional\n  skipNodeModules: false,\n})\n\nconst mod = await import('some-module', { with: { cache: 'no' } })\n\nclearRequireCache() // Optional: clear CommonJS cache if needed\n\n// or\nconst mod2 = await import(`no-cache://some-module`)\n\nexpect(mod).not.toBe(mod2) // Different instances\n\nderegister() // Optional: deregister the hooks when no longer needed\n```\n\n## Known Limitations\n\n- Supports Node.js v22.18.0 and later; Deno is not supported.\n- Yarn PnP is not supported on Node.js versions earlier than v24.\n- In Bun, `clearRequireCache` works, but `init` is unnecessary because ESM imports behave the same as CommonJS requires.\n- Only ESM modules are supported by default. The CommonJS cache can be cleared with `clearRequireCache`.\n- `require(esm)` is supported starting in Node.js v24.13.1.\n\n## Sponsors\n\n<p align=\"center\">\n  <a href=\"https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg\">\n    <img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>\n  </a>\n</p>\n\n## License\n\n[MIT](./LICENSE) License © 2025-PRESENT [Kevin Deng](https://github.com/sxzz)\n\n<!-- Badges -->\n\n[npm-version-src]: https://img.shields.io/npm/v/import-without-cache.svg\n[npm-version-href]: https://npmjs.com/package/import-without-cache\n[npm-downloads-src]: https://img.shields.io/npm/dm/import-without-cache\n[npm-downloads-href]: https://www.npmcharts.com/compare/import-without-cache?interval=30\n[unit-test-src]: https://github.com/sxzz/import-without-cache/actions/workflows/unit-test.yml/badge.svg\n[unit-test-href]: https://github.com/sxzz/import-without-cache/actions/workflows/unit-test.yml\n","publish_time":1765391913307,"_cnpm_publish_time":1765391913307,"dist-tags":{"latest":"0.4.1"}}