Today we will learn how to create a NPM package like this https://www.npmjs.com/package/@vanpariyar/text-manipulation
So I found the below step that you can easily register your NPM package with your scoped. 🪔 ( This is Lamp in India 💡 😄)
Like if you see
- Node.js installed
- git installed
- NPM account for publishing package.
Let’s start the development now.
mkdir text-manipulation cd text-manipulation Npm login
npm login enter your username, password, email
npm init --scope=@my-org // OR npm init --scope=@my-username
Now you will have the prompt that you need to answer for your package. Like the Package version, Github Repo etc.
open index.js in your preferred editor. Then write your code in the file. 🖊
.gitignore to ignore
# .gitignore node_mudules
Then if you have a public account you need to add this parameter with the
npm publish command.
npm publish --access public
Nice, 🎉 You have published your first NPM package.
If it is helpful and saves your valuable Time ⏱ please show your support 👇.
Buy me A Coffee, Thank you and canva ( For Beautiful designs ). Thanks for the reading 👍.