Logging in to npm:
If you haven't already, create an account on npmjs.com. Log in to your npm account from the command line using npm login. Enter your username, password, and email address when prompted.
Publishing the Package:
Run npm publish from the root directory of your package. If your package is scoped (i.e., it begins with @yourusername/), and you want it to be public, use npm publish --access public.