Course info
Dec 11, 2015

NPM is not just for Node developers - it has become the default package manager for front end JavaScript developers as well. This course will take you from knowing nothing about NPM to being an expert in using NPM to manage the dependencies for your project. Additionally, you will learn how to publish packages for other developers to use in their own projects, how to keep those packages updated, and how to coordinate them with your github repository.

About the author
About the author

Joe has been a web developer for the last 13 of his 16+ years as a professional developer. He has specialized in front end and middle tier development . Although his greatest love is writing code, he also enjoys teaching and speaking about code.

More from the author
Unit Testing in Angular
3h 20m
22 May 2018
Angular: The Big Picture
1h 7m
13 Dec 2017
More courses by Joe Eames
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Joe Eames and welcome to my course, NPM Playbook. I'm an open-source developer and conference organizer and I'm super excited to present this course to you. NPM is the de facto module manager for JaveScript development, both on the front and back end and is replacing things like Bower and NuGet. So learning how to work with it is valuable for anyone who does web development. In this course, we are going to learn all of the major features of NPM and a few you may not have even heard of. The major topics we will cover are using NPM to track your dependencies, using it to write simple scripts for your projects, and publishing your own module for other developers to use in their projects. By the end of this course, you'll know how to use NPM with any web project you work on and how to manage your dependencies effectively. Before beginning this course, you should be familiar with JavaScript, although you don't have to be an expert by any means. I hope you'll join me on this journey to learn NPM with the NPM Playbook course at Pluralsight. (upbeat music)

Advanced NPM
When you find a module on GitHub that you want to use, almost all modules are going to tell you how to install them with npm. For example, here's the page for Express, and you can see right here that it gives us the command, npm install express. But you may find a repo online that you don't know what the name is for it in npm, or it might be a fork of an existing project that's been modified for some reason, maybe custom to you, and therefore you have a GitHub URL that you know that you want to install from, but you don't necessarily know what the npm install name is. In this case, you can install directly from GitHub, using just the URL. So if I wanted to install Express from a URL, I can just give it the full URL, and that's going to install Express for me. This is exactly the same as if I were to type npm install express. And one thing to note about this, is it's not limited to just GitHub, if for some strange reason you have a package that's available on some other URL, you can just type in that URL as well, and npm will install it from that location.

Publishing Your Own Package
In order to get ready to publish with npm, you've got to prepare your user for publishing. For most people that means they'll actually have to create a user account with npm first. In order to do that you go to nmpjs. com and click sign up. From here, simply follow the prompts in order to create your user account and be sure to remember your user name and password. At that point, you can go out to your command line, you'll need to add the user using the npm adduser command. Executing this will prompt you to type in your username, your password and enter your email address. Once you've done all that it will add an npm authentication token to your npm RC file. Your user is now setup and you can begin publishing packages.