TL;DR, view the example .npmrc file
I like shiny rocks and big numbers, so I decided to push my NPM work to my github packages. NPM allows you to scope one scope to a registry. Which wasn't what I wanted.
I wanted to push both to the npmjs registry and the github registry, without writing the url every dang time!
So, exploiting some naming schemes, I'm able to present you this: @@
!
According to the NPM docs on creating an account, you cannot use @
in your usernames.
And by design, every username is a scope, referrable by @username
.
So, I tried putting double at-signs, and woila! I have a name that can't be created on the registry which can be used for shorthands!
Now I have a registry shortcut!
# setup registry with fake scope
npm login --auth-type=legacy --registry=https://registry.site --scope=@@registry
#publish a package to both registries
npm publish # to npmjs
npm publish --scope=@@registry # to the private registry!
npm
naming registries
registry shortcuts