O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding NPM - Node.js Package Manager

Video Description

Understand and practice NPM. Learn how to use NPM in Node.js, how to install NPM packages, how to configure NPM scripts

About This Video

  • Much better understanding of NPM having gone through the course.
  • The videos are short and to the point and will help you to quickly grasp each and every concept.

In Detail

In this course the author will explain you what is NPM and how it is used. You will learn how to initialize new project, how to install new dependencies and explore their child dependencies. We will also discuss what is Semantic Versioning and what Major, Minor and Patch versions mean. You will also understand what is the purpose of the package-lock.json file.

The author will explain to you what is the purpose of the NPM scripts and how they should be used. We will talk about built-in NPM scripts and a custom script. Also, we will combine several NPM scripts in a one using npm-run-all external package.

You will understand what is executable script and what is the purpose of the .bin folder in the node_modules folder. He will explain to you what is shebang line and how it is used on the Unix-based system and on Windows. Happy learning!

Table of Contents

  1. Chapter 1 : Introduction to the NPM
    1. Exploring NPM packages 00:01:32
    2. Package.json and init 00:03:12
    3. Semantic Versioning 00:04:46
  2. Chapter 2 : Installation of the NPM packages
    1. Packages Installation 00:02:14
    2. Install package in the project 00:04:42
    3. CHALLENGE - Install Semver package 00:00:37
    4. CHALLENGE - Install Semver Package – SOLUTION 00:11:04
    5. Install Browserslist - package with own dependencies 00:03:22
  3. Chapter 3 : Dependencies vs Development Dependencies
    1. Dependencies and Development Dependencies 00:02:44
    2. Examine Development Dependencies 00:06:22
    3. Browser App vs Server Package 00:04:41
    4. CHALLENGE - Clock Browser Application 00:01:42
    5. CHALLENGE - Clock Browser Application – SOLUTION 00:12:07
    6. Clock Challenge Summary 00:02:19
    7. Browser App vs Public Package 00:06:51
  4. Chapter 4 : NPM packages versions and package-lock.json file
    1. Exploring Package Information and Versions 00:02:45
    2. Installing Specific Package Version 00:03:25
    3. Why package-lock.json file is needed? 00:04:29
    4. CHALLENGE - Reinstall old package version without lock file 00:00:59
    5. CHALLENGE - Reinstall old package version without lock file – SOLUTION 00:03:07
    6. How lock file is handled 00:10:55
    7. Lock file summary 00:00:38
  5. Chapter 5 : Updating NPM packages
    1. Update NPM packages overview 00:01:33
    2. CHALLENGE - Update project dependencies 00:00:41
    3. CHALLENGE - Update project dependencies – SOLUTION 00:05:07
  6. Chapter 6 : NPM Scripts
    1. Introduction to the NPM scripts 00:02:50
    2. Start NPM script 00:02:21
    3. CHALLENGE - Create prestart script 00:01:28
    4. CHALLENGE - Create prestart script – SOLUTION 00:07:13
    5. Custom NPM scripts 00:02:48
    6. CHALLENGE - Run NPM scripts simultaneously 00:01:15
    7. CHALLENGE - Run NPM scripts simultaneously – SOLUTION 00:03:26
  7. Chapter 7 : Executable scripts in the NPM
    1. NPM .bin Folder with Executable Scripts 00:04:46
    2. Explore .bin Folder on the Mac 00:02:49
    3. Explore .bin Folder on Windows 00:01:29
    4. NPM Scripts Wrap-Up 00:01:25