Skip to main content

nyprm

๐Ÿ”€ Registry manager for npm, pnpm, yarn, bun and deno

CategoryStack
LanguageTypeScript
CLIcommander
Buildtsdown
TestVitest
Lintoxlint, oxfmt

Install#

sh
npm install -g nyprm --registry=https://registry.npmmirror.com/

Requires Node.js 22.13 or later. None of the package managers need to be installed: nyprm edits their config files directly.

Usage#

text
Usage: nyprm [options] [command]
Registry manager for npm, pnpm, yarn, bun and deno
Options:  -V, --version             output the version number  -h, --help                display help for command
Commands:  ls|list                   list preset registries  current [options]         show the registry set in each config file  use [options] <registry>  switch to a preset registry or any registry URL  reset [options]           remove the registry setting to use the defaults  test                      measure the response time of preset registries  help [command]            display help for command
sh
nyprm use npmmirror                  # preset: npm, npmmirror, tencent, huaweinyprm use https://npm.example.com/   # any registry URLnyprm use npmmirror --local          # current project onlynyprm currentnyprm reset

Config files#

FileRead byWritten
~/.npmrcnpm, pnpm, bun, deno, yarn 1always
~/.yarnrc.ymlyarn 2+always
~/.yarnrcyarn 1only if it already sets registry
~/.bunfig.tomlbunonly if [install] already sets one

With --local, the same files in the current directory are used (bunfig.toml without the dot). .yarnrc.yml is written there only for yarn 2+ projects.

  • Only the registry line changes. Auth tokens, scoped registries and other settings are kept.
  • Before a file changes, the previous version is saved next to it as <file>.nyprm.bak.
  • NPM_CONFIG_USERCONFIG and XDG_CONFIG_HOME are honored.
  • pnpm reads the registry from ~/.npmrc before its own auth.ini, so ~/.npmrc is enough.

Development#

sh
pnpm installpnpm buildpnpm testpnpm lintpnpm formatpnpm typecheck

Release#

sh
pnpm release

bumpp bumps the version, commits, tags and pushes. The tag triggers the release workflow, which stages the package on npm with trusted publishing (provenance included) and creates a GitHub release with changelogithub. The version goes live after a maintainer approves it with 2FA on the package's Staged Packages tab on npmjs.com, or with npm stage approve <stage-id>.

License#

MIT ยฉ tlyboy