17 Aug 2021

Publishing an npm package

When you want to test a package locally before pushing to npm or yarn, you can use the following commands

On the package directory

$ yarn link

On the project where you wish to test it

$ yarn link package-name

To remove the connection from project

$ yarn unlink package-name

To stop linking the package

yarn unlink

Replace yarn with npm depending on your use case

cloning a specific branch

$ git clone -b <branch> <remote_repo>