-
Test your pkg before publishing to NPM
-
Make a NODE Project by initializing
npm init
-
Add this in your package.json file
"bin": "index.js",
-
Add this on top of your file.
#! /usr/bin/env node
-
Create account on npmjs.com
-
Login to npm on CLI (Terminal)
npm login
-
Publish your work with
npm publish --access=public
If a package name is not available use your username as prefix
"name": "@username/unavailable-pkg-name",
"name": "@shehza-d/calculator",