A fetch library specialized for interacting with the npm registry. Current version: 4.1.2. It is part of the pnpm monorepo and designed to handle npm registry quirks like Corgi metadata (compressed manifests). It ships TypeScript types and requires Node.js >=10.13. Its key differentiator is built-in support for the npm registry's full versus filtered metadata, as well as authentication and retry logic tuned for the npm API. It depends on @pnpm/logger for logging.
npm install fetch-from-npm-registryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the fetcher with a token from environment variable, requesting full metadata.
Switch to dynamic import or update to ESM-compatible setup.
Use `filtered: false` instead of `fullMetadata: true`.
Install @pnpm/logger as a dependency or peer dependency.
Check for `.ok` and `.status` property, not `statusCode`.
If you need full package metadata, explicitly set `filtered: false` in options.
Upgrade to Node 14 or later.
Use `const createFetcher = require('fetch-from-npm-registry').default` for CJS, or better switch to ESM import.Run `npm install @pnpm/logger` or `pnpm add @pnpm/logger`.
Use `response.text()` and parse manually, or upgrade to version >=3.0.0.
Ensure the URL starts with 'https://' or 'http://'.