{"_id":"import-without-cache@0.4.1","bugs":{"url":"https://github.com/sxzz/import-without-cache/issues"},"dist":{"shasum":"8d0f656f2810be80753cc00f13af39e1cf2eff3e","tarball":"http://registry-npm.ywwl.com/import-without-cache/download/import-without-cache-0.4.1.tgz","integrity":"sha512-vXoV9PjKHEednCUu01e98TkImxy67e3BJXbTIOmIq4Hyzw3IAwYRcuPkfeTzJzwyyts4kjuA73x+pWJLc4f86A==","fileCount":5,"unpackedSize":7824,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/import-without-cache@0.4.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDirJLgu8EH63nG69qvfjwWluvlWiPovp8R2gtKaI4LzwIhAIz2YtTAnJI7mCcib+yK6lK/mC5MmuaHCDHRerASMpZJ"}],"size":3384,"noattachment":false,"key":"/import-without-cache/-/import-without-cache-0.4.1.tgz"},"name":"import-without-cache","type":"module","author":"Kevin Deng <sxzz@sxzz.moe>","engines":{"node":"^22.18.0 || >=24.0.0"},"exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"funding":"https://github.com/sponsors/sxzz","license":"MIT","scripts":{"dev":"tsdown --watch","lint":"eslint --cache .","test":"node --test tests/index.test.ts","build":"tsdown","format":"prettier --cache --write .","release":"bumpp","lint:fix":"pnpm run lint --fix","test:bun":"bun test tests/bun.test.ts","typecheck":"tsc --noEmit"},"version":"0.4.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c718c4c3-0299-4a8a-bdc3-447e153ecb43"},"approver":{"name":"sxzz","email":"npm@sxzz.moe"}},"homepage":"https://github.com/sxzz/import-without-cache#readme","prettier":"@sxzz/prettier-config","devEngines":{"packageManager":{"name":"pnpm","onFail":"download","version":"12.4.2"}},"repository":{"url":"git+https://github.com/sxzz/import-without-cache.git","type":"git"},"description":"Import ES modules without cache.","directories":{},"maintainers":[{"name":"sxzz","email":"npm@sxzz.moe"}],"publishConfig":{"access":"public"},"devDependencies":{"bumpp":"^12.3.0","eslint":"^10.10.0","tsdown":"^0.23.0","prettier":"^3.9.7","@types/bun":"^1.4.2","typescript":"^6.0.2","@types/node":"^25.6.0","@sxzz/eslint-config":"^8.6.0","@sxzz/prettier-config":"^2.3.3","@typescript/native-preview":"npm:typescript@^7.0.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/import-without-cache_0.4.1_1789573801192_0.2874710722885825"},"_hasShrinkwrap":false,"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":1789573801278,"_cnpm_publish_time":1789573801278,"dist-tags":{"latest":"0.4.1"}}