Steps:
-
Create an org on npmjs.com - private costs money. Public is free.
-
Create a local git repo with your library code (required).
-
npm login to login to your account
-
Publish the library
npm publish --access publish
-
npm install in any other project to install the library.