Publishing your first package
We have seen how to install packages from the npm registry, but we can also publish our own packages. This is great if we want to share our code with other developers or if we want to reuse our code in other projects.
So, let’s see how to publish our first package in the npm registry.
Registries
Before we start, we need to understand how the npm registry works. The npm registry is a public repository where all the packages are stored. This is the default registry that npm uses, but you can also use other registries such as Verdaccio (https://verdaccio.org/) or GitHub Packages (https://github.com/features/packages).
We will use the npm registry in this chapter, but the process is very similar for other registries. Some developers publish their packages in multiple registries, so you can choose the one that you prefer.
Note
If you want to publish a private package, it is more common to use a private registry such as Verdaccio or...