pnpr/client/README.md
Client library for the pnpr server. Resolves a project's dependencies server-side and returns the resolved lockfile.
POST /v1/install to the pnpr server with the project's dependencies (and the existing lockfile, if any, for incremental resolution).pnpr is a stateless resolver: it stores no tarballs and serves no file content.
This package is used internally by pnpm when the pnprServer config option is set. It is not intended to be called directly, but can be used programmatically:
import { fetchFromPnpmRegistry } from '@pnpm/pnpr.client'
const { lockfile, stats } = await fetchFromPnpmRegistry({
registryUrl: 'http://localhost:4000',
dependencies: { react: '^19.0.0' },
devDependencies: { typescript: '^5.0.0' },
})
console.log(`Resolved ${stats.totalPackages} packages`)
// lockfile is ready for headless install
Add to pnpm-workspace.yaml to enable automatically during pnpm install:
pnprServer: http://localhost:4000