Publishing to NPM
What's a symbolic link? It's a kind of file, normally hidden from us, that points to another file, much like a shortcut.
The main purpose of using symbolic links, or symlinks, is that we can link a local dependency and use it in another project. This is useful for developing new libraries or packages where we can test them in real projects.
Both Yarn and NPM can be used to make symbolic links with just one command:
~: yarn link ~: npm link
Taking the code we implemented in this chapter, in the root of our project, we can execute the yarn link
command:
~: yarn link yarn link v1.22.10 success Registered "typed-state-plugin". info You can now run `yarn link "typed-state-plugin"` in the projects where you want to use this package and it will be used instead. Â Â Done in 0.07s
Magically, we'll get a symbolic link of the entire code base where we implemented the plugin and it is ready to use in our Amazhop applications...