Javascript: Node Package Manager (NPM)

  • What are NPM’s
  • Set Up

In this blog we will cover what NPM is and what they do in an abstract manner that serves to give context so that reader can gain a basic understanding. If the reader is just starting to use React or learning Javascript or new to programming in general, then this post will be useful. For more veteran programmers, please skip to the end of the article where links will be provided that lead to the more complex nature of NPM.

NPM, or Node Package Manager, is a software library (similar to gem’s for Ruby users) that is open to the public to quickly solve issues that have already been solved before. NPM’s also give programmers tools to make certain tasks easier. NPM especially helps when using frameworks like React.

Setting up NPM is pretty straightforward. First, check if you node installed, if you do then you should already have NPM installed. Check by typing in the following into your command line interface.

npm -v

If you don’t have node installed click on this link that will take you to the node site -> https://nodejs.org/en/

Once you have NPM installed, you can install packages by typing the following code block into your command line interface (CLI). Make sure you are in your project folder so that the proper packages get installed in the correct location. You can search through the npm website to find packages and descriptions of their functionality. https://www.npmjs.com/

// Windows example

C:\>npm install <package>

// Mac example

npm install <package>

Simply put, NPM and it’s packages are great for daily programmer. It saves times, makes coding a lot easier, and makes coding more straightforward. This is the very beginning of NPM usage and there are deeper rabbit holes to be found. The following are a list of links that’ll give you these holes to dive into.

Alternative introduction to NPM
https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/
How to use npm’s
https://flaviocopes.com/how-to-use-npm-package/
Creating and Publishing your own npm’s
https://docs.npmjs.com/creating-and-publishing-private-packages

Leave a comment

Design a site like this with WordPress.com
Get started