
How to create your first npm package? 🧰
7 August, 2022
0
0
0
Contributors
What is NPM
NPM stands for Node Package Manager and is the default JavaScript package manager powered by Node.js. The npm manager has two parts:
•
CLI (Command Line Interface) — a tool for publishing and downloading packages,
•
online repositories containing over 2 million JavaScript packages.
Don't have an account?
Navigate to npmjs.com and click sign up.
1. Create an npm project
•
Create a folder named
arraySort
2. Initialize project as npm package
a) Using npm init -y or -yes
•
This process will automatically generate a
package.json
file with default options.
b) Using npm init
•
In this process, you will be asked a number of questions such as the name of the author, the description, and the license, etc.

3. Create a file named index.js with this content:
4. Create a README.md (optional)
•
You should provide a brief description of the repository and its functions.
5. Login into NPM
6. Publish the package
You Did It!
Congratulations, you have published your first NPM package!