@simon_he/fetch-npm-cjs
v0.0.30
Published
## :coffee:
Readme
Vitesse
:coffee:
License
Sponsors
TODO
- [x] Stage heavy tarball fallbacks so CDN/private resources get a chance to finish before
runFromOtherstarts. - [x] Cache resolved tarball URLs per
name@versionto skip redundant metadata downloads. - [x] Stream tarball downloads directly into extraction to avoid writing and rereading
.tgzfiles. - [x] Reuse keep-alive HTTP agents and explicit request aborts/timeouts for every registry/mirror call.
- [x] Move
npm pack/CLI fallbacks behind opt-in flags or final retry tiers to keep the fast path lightweight.
Configuration
allowCliFallback: per-call override that defaults to the environment flag (ortruewhen unset). Set tofalseto skip the CLI fallback entirely, ortrueto force it even if the environment disabled it.FETCH_NPM_ALLOW_CLI_FALLBACK: global default for whether thenpm packfallback is allowed. Leave unset (or set totrue) to keep compatibility, set tofalseto disable the CLI path everywhere without touching code.signal: pass anAbortSignalto the CJS fetch helpers to cancel CDN races early. When aborted, all in-flight CDN requests are stopped and heavy fallbacks are skipped.allowRemoteImport: ESM fetch option that lets you disable remoteimport()attempts (defaults to automatic detection). Set tofalsein Node environments to skip unsupported HTTPS imports and go straight to the CJS-based fallback, ortrueto force remote imports when running in runtimes that support them.FETCH_NPM_ALLOW_REMOTE_ESM: environment flag that controls the defaultallowRemoteImportbehavior. Leave unset for auto-detection, set tofalseto always skip network imports, ortrueto attempt them even when the runtime might not support HTTPS specifiers.
