
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Switch between different .npmrc files with ease and grace.
If you use a private npm registry, you know the pain of switching between a
bunch of different .npmrc files and manually managing symlinks. Let that be a
problem no more! npmrc is here to save the day, by making it dead simple to
switch out your .npmrc with a specific named version. It also tries to protect
you from your own stupid self by making sure you don't accidentally overwrite an
.npmrc that you actually want to keep.
npm install -g npmrc
➜ ~ npmrc --help
npmrc
Switch between different .npmrc files with ease and grace.
Usage:
npmrc list all profiles
npmrc [name] change npmrc profile (uses fuzzy matching)
npmrc -c [name] create a new npmrc profile called name
npmrc -r [registry] use an npm mirror
Available mirrors for npmrc -r:
au - Australian registry mirror
eu - European registry mirror
cn - Chinese registry mirror
default - Default registry
Calling npmrc without arguments creates an ~/.npmrcs/ directory if it doesn't exist,
and copies your current ~/.npmrc as the 'default' .npmrc profile.
➜ ~ npmrc
Creating /Users/conrad/.npmrcs
Making /Users/conrad/.npmrc the default npmrc file
Activating .npmrc 'default'
➜ ~ npmrc -c newprofile
Removing old .npmrc (/home/rvagg/.npmrcs/default)
Activating .npmrc 'newprofile'
A blank profile will be created. To point your profile to a non-default registry:
➜ ~ npm config set registry http://npm.nodejs.org.au:5984/registry/_design/app/_rewrite
Then use npm adduser or npm login to authenticate with the new profile.
➜ ~ npmrc
Available npmrcs:
* default
work
➜ ~ npmrc work
Removing old .npmrc (/Users/conrad/.npmrcs/default)
Activating .npmrc 'work'
You can also pass only the first few characters of a profile and npmrc will
autocomplete the profile's name.
➜ ~ npmrc def
Removing old .npmrc (/Users/conrad/.npmrcs/work)
Activating .npmrc 'default'
npmrc <name> will also go to some lengths to make sure you don't overwrite
anything you might care about:
➜ ~ npmrc default
Removing old .npmrc (/Users/conrad/.npmrcs/work)
Activating .npmrc 'default'
➜ ~ npmrc default
Current .npmrc (/Users/conrad/.npmrc) is already 'default' (/Users/conrad/.npmrcs/default)
➜ ~ rm ~/.npmrc
➜ ~ touch ~/.npmrc
➜ ~ npmrc default
Current .npmrc (/Users/conrad/.npmrc) is not a regular file, not removing it
➜ ~ rm ~/.npmrc
➜ ~ npmrc default
Activating .npmrc 'default'
NPMRC_STORE - Path to directory of profiles. Default: ~/.npmrcs/NPMRC - Path to the npmrc file used by npm. Default: ~/.npmrcFor your convenience, you can change registries easily using the -r
flag. Currently we provide aliases for:
➜ ~ npm -r eu
Using eu registry
➜ ~ npm info npmrc
npm http GET http://registry.npmjs.eu/npmrc
^C
➜ ~ npm -r default
Using default registry
➜ ~ npm info npmrc
npm http GET https://registry.npmjs.org/npmrc
^C
3-clause BSD. A copy is included with the source.
FAQs
Switch between different .npmrc files with ease and grace
We found that npmrc2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.