In this quick run through, we will see how you can simply publish a package into your Nplfared
registry.
This will allow you easily share private package for your project and share them with your team 🤝.
Let's create a simple package that will be published into our registry.
Let's add some code to our package
Now we need to update our package.json
file
You need to add a publishConfig
property to our package.json
file.
This property will allow us to specify the registry where we want to publish our package.
You will need to replace http://your-npflared-registry.dev
with your own registry url.
If you already have a token with dedicated permission you can skip this section
Check this in order to generate a new token
In order to authenticate to your registry you will need to add a .npmrc
file with the following content
You can now download, upgrade and consume your package 🔥
First make to have setup an .npmrc
file with a token having the right accesses.
Then you can run the following command:
If you are using scoped package eg @acme/math
you can add the following to your .npmrc
file
In order to automatically resolve your scoped package with your private registry.
For example I have multiple package in my private registry scoped with @thomascogez
like (@thomascogez/common
, @thomascogez/tsconfig
@thomascogez/biome-config
, ...)
That I use in my projects.
In every project want to use them i add the following to my .npmrc
file
If you make change to your package, you will need to publish a new version.
This is really easy, you will need to bump the package version in your package.json
file and then hit the publish button again !