A lightweight API server to get npm package metadata, resolve the latest versions on server, and batch multiple package resolutions in one request.
by antfuTypeScript
Last 12 weeks · 6 commits
5 of 6 standards met
🔗 Linked issue resolves #22 🔄 Context JSR provides an npm-compatible registry at , but there's currently no way to query JSR packages through fast-npm-meta without changing the global (which would break npm lookups). 📚 Description Add a prefix that automatically routes requests to the JSR npm-compatible registry. is resolved to on Batching with npm packages works: Response returns the original JSR name (e.g. ) instead of the internal Changes: New — prefix detection and name conversion — add optional param to — detect prefix before parsing, pass registry info to handler and — use display name and registry from options — document JSR usage
Add multi-stage Dockerfile (node-server preset) Add .dockerignore Allow overriding git revision and Nitro preset via env vars Document Docker usage in README Closes #19 🔗 Linked issue resolves #19 🔄 Context Currently the server is hardcoded to the preset with no official way to self-host. Users who want to deploy on their own infrastructure need a Docker image. 📚 Description Add a multi-stage Dockerfile that builds the server with the Nitro preset, producing a minimal production image containing only Node.js and the compiled directory. Changes: Dockerfile: 3-stage build (deps → build → runtime), final image based on .dockerignore: exclude , , , etc. server/nitro.config.ts: allow and env var overrides, with try-catch fallback for in environments without README.md: add Docker build & run instructions with environment variable reference
Description The PR closes #23 by adding the retry mechanism. Linked Issues #23 Additional context The PR intentionally only exposes a subset of the retry options, which enables us to replace the retry implementation in the future also, options like or should not be exposed anyway The PR adds as a dependency, which breaks zero-dependency. I can move it to dev deps and make it bundled if you wish.
Summary replace direct and usage in the Nitro server with migrate range checks, loose version cleaning, and comparisons to verkit's functional named APIs while preserving prerelease and loose-query behavior publish as a runtime dependency instead of inlining it into the CLI bundle update the pnpm catalog and lockfile, and add focused coverage for loose version selection Motivation verkit is a pure ESM, zero-dependency SemVer implementation with first-class TypeScript declarations and functional, tree-shakeable named exports. This fits the server's ESM-based Nitro and Netlify Edge build, avoids CommonJS interop for direct version operations, and removes the need for . Keeping external lets package managers install it as a normal production dependency and reduces the generated CLI bundle from 30.61 kB to 11.40 kB. Compatibility is migrated to , preserving loose exact-version normalization retains its default prerelease behavior, while and map to and the private Netlify Edge production build inlines verkit and contains no external verkit or semver runtime import the published package exports and CLI behavior remain unchanged; the packed manifest declares Related https://github.com/e18e/ecosystem-issues/issues/277 https://github.com/nuxt/nuxt/pull/35713 Validation (18 tests passed, no type errors) built package import and Netlify Edge bundle syntax/external-import smoke checks packed-manifest validation and fresh tarball install followed by CLI
Repository: antfu/fast-npm-meta. Description: A lightweight API server to get npm package metadata, resolve the latest versions on server, and batch multiple package resolutions in one request. Stars: 215, Forks: 18. Primary language: TypeScript. Languages: TypeScript (94.5%), JavaScript (5.5%). License: MIT. Homepage: https://npm.antfu.dev/vite@alpha+nuxt Latest release: v2.2.0 (1mo ago). Open PRs: 3, open issues: 6. Last activity: 1mo ago. Community health: 85%. Top contributors: antfu, sxzz, 9romise, alex-key, kricsleo, outslept, anubra266, antongolub, GeoffreyParrier, ElshadHu and others.