Understanding NPM - Node.js Package Manager

Video description

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!

What You Will Learn

  • Initialize any project using NPM init
  • Install project dependencies
  • Understand what is the difference between dependencies and development dependencies
  • Explain what is Semantic Versioning and what different kinds of packages versions mean
  • Explain the difference between Browser Application and Server Package
  • Understand the purpose of the "package-lock" file
  • Update project dependencies
  • Configure NPM scripts and execute them
  • Combine NPM scripts into the one script
  • Explain what is executable script and how it is executed on the Mac and on Windows

Audience

The course is for JavaScript developers who want to know how to properly use NPM.

About The Author

Bogdan Stashchuk:

Table of contents

  1. Chapter 1 : Introduction to the NPM
    1. Exploring NPM packages
    2. Package.json and init
    3. Semantic Versioning
  2. Chapter 2 : Installation of the NPM packages
    1. Packages Installation
    2. Install package in the project
    3. CHALLENGE - Install Semver package
    4. CHALLENGE - Install Semver Package – SOLUTION
    5. Install Browserslist - package with own dependencies
  3. Chapter 3 : Dependencies vs Development Dependencies
    1. Dependencies and Development Dependencies
    2. Examine Development Dependencies
    3. Browser App vs Server Package
    4. CHALLENGE - Clock Browser Application
    5. CHALLENGE - Clock Browser Application – SOLUTION
    6. Clock Challenge Summary
    7. Browser App vs Public Package
  4. Chapter 4 : NPM packages versions and package-lock.json file
    1. Exploring Package Information and Versions
    2. Installing Specific Package Version
    3. Why package-lock.json file is needed?
    4. CHALLENGE - Reinstall old package version without lock file
    5. CHALLENGE - Reinstall old package version without lock file – SOLUTION
    6. How lock file is handled
    7. Lock file summary
  5. Chapter 5 : Updating NPM packages
    1. Update NPM packages overview
    2. CHALLENGE - Update project dependencies
    3. CHALLENGE - Update project dependencies – SOLUTION
  6. Chapter 6 : NPM Scripts
    1. Introduction to the NPM scripts
    2. Start NPM script
    3. CHALLENGE - Create prestart script
    4. CHALLENGE - Create prestart script – SOLUTION
    5. Custom NPM scripts
    6. CHALLENGE - Run NPM scripts simultaneously
    7. CHALLENGE - Run NPM scripts simultaneously – SOLUTION
  7. Chapter 7 : Executable scripts in the NPM
    1. NPM .bin Folder with Executable Scripts
    2. Explore .bin Folder on the Mac
    3. Explore .bin Folder on Windows
    4. NPM Scripts Wrap-Up

Product information

  • Title: Understanding NPM - Node.js Package Manager
  • Author(s): Bogdan Stashchuk
  • Release date: October 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789955958