What Is NPM?

Chuk Orakwusi
2 min readOct 18, 2020

--

A drawback of attending a coding bootcamp (especially as a complete novice) is that when you come across something new that just works and needs very little from you to work, you accept it as is and move on to the next topic. When I forked my first React repo and typed in “npm i” in the command line (as i was instructed), a flurry of activity happened, with lots of code seemingly typing itself and in a variety of colours. When the self-typing stopped and the rectangular block cursor returned, I knew the repo had been installed and I could start learning. With so much to learn, I was very focused on getting past the heavier topics and then returning to the stuff “that just works” after my course. One of those latter topics was ‘NPM’.

NPM which stands for Node Package Manager is included by default when node.js is installed. There are two ways to build an app or website. You could build it all from scratch, create your own packages and modules etc which will take you a while…a long while but is possible or you could do what most of the JavaScript dev community does and use NPM.

A Package is a series of code bundled up into a unit. Packages can be vital building blocks used to build an app or website. NPM is a library that consists of these packages for developers to access. With NPM, you have access to reusable modules which have been created by developers, used repeatedly by other developers and available for you to access from an online repository. From this repository, developers can also publish tools written in JavaScript. Tools that can be used on the front end (web pages) or command line.

NPM also has a command line tool that lets developers either install or uninstall packages. Each package has a version when it’s downloaded and as time goes on, your package version updates. NPM makes it easy to keep packages up to date and also lets you revert back to a previous version of a package. Many packages are built on top of other packages, these are called “dependencies” as they will need to utilise another package to be able to work. NPM will search for all the dependencies and will install them in your application.

A great advantage of using NPM is that once your app is complete and on github, it will have all the packages used (and with the right versions registered) so if someone else decides to fork your repo a couple years down the line, NPM will know to install the package versions used at the point of when the app was created.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Chuk Orakwusi
Chuk Orakwusi

No responses yet

Write a response