Well, if you are here and think that npm stands for Node Package Manager, I have to tell you that's also correct, but it's not complete. npm is not an acronym, but it's a recursive bacronym for * npm is not an acronym*. In short, npm is an bacronym, not an acronym like many people believe.

At this very moment while writing this post, I currently have 561 packages. You can view them here (npm/~ionicabizau).

🙌 How I do it

I started learning Node.js at the end of the year 2012. I was enjoying using modules by others, but I published my first npm package in August 2013. It was youtube-api–a friendly Node.js wrapper for the YouTube API. 📺

I liked the npm publishing workflow and I didn't stop there. I created more and more packages.

🚀 How to create an npm package?

Assuming you have Node.js and npm installed, you have to generate a package.json file then write your code and publish it:

Tests

After writing a few tests, the module is ready to be published on GitHub and npm.

Publishing

We have to create a GitHub repository. I use ghrepo by @mattdesl (thanks! 🍰 😁). It's smart enough to create the GitHub repository with the right data (taken from the local git repository url and package.json).