
Master course navigation by exploring lecture, practice, and two-video challenge videos with diagrams and slides, while using the video player's speed, quality, and lecture list controls.
Let's explore together some popular NPM packages
Learn to create and configure a package.json in the root of your project, using npm init or yarn init to set name, version, author, and dependencies.
Understand semantic versioning for npm packages, including major, minor, and patch versions, and how to use constraints like exact, caret, and tilde to manage dependencies.
Learn to install packages with npm or yarn, run npm i to install package.json, and add packages with npm install package-name or yarn add, using --save-dev or -D for development.
Install moment.js with npm install moment (or yarn add moment) and require it in index.js to format dates and days; observe moment in package.json, package-lock.json, and node_modules.
install the semver package as a project dependency and practice version checks using helper methods like valid, greater than, and less than, noting its use in Babel.
Install the semver package with npm or yarn, inspect its package.json and bin, and demonstrate methods like valid, greater than, coerce, range, satisfies, inc, and parse to manage versions.
install browserslist with npm, observe three packages added, and learn how dependencies and development dependencies are installed and reflected in package.json and package-lock.json.
Explain the difference between project dependencies and development dependencies in npm, note that development dependencies are not transitive, and show how npm install and npm install --production affect package.json dependencies.
Practice explains how to manage npm dependencies by installing and removing packages, distinguishing dependencies from development dependencies, and using npm install --production to install only dependencies, and understanding node_modules behavior.
Decide when to use dependency versus development dependency for browser apps or server packages, and learn why HTML files, index.html, commonjs, ES6 modules, and bundlers like Webpack with moment.js matter.
Embed moment.js as a browser dependency in a single index.js file, format the clock time in the browser, and observe that browser apps ignore node_modules and package.json.
Understand when to classify NPM packages as dependencies or development dependencies for browser apps and public packages, and learn how bundling affects final builds.
Explore how to use npm view to inspect package information—current version, license, dependencies, and maintainers—plus last publish date and how to install specific or pre-release versions.
Learn to install a specific package version with NPM install package@version, audit for vulnerabilities with NPM audit, and revert to the current stable release using the moment example.
Understand how the package lock file records exact dependency versions and nested dependencies to ensure identical installations across machines when publishing to GitHub and running npm install.
Understand how the log file is created automatically since 5.0.0, updated with npm installs, committed with package.json to lock exact dependencies, while excluding node_modules and using dev true flags.
The log file ensures consistency of all dependency versions, including child dependencies, and is created and updated automatically; commit it to source control to benefit when updating packages.
Use the npm update command to refresh project dependencies within semver rules, updating package.json and the log file, and install changes in node_modules; also learn updating a single package.
Learn to initialize a new npm project, install two older package versions—one with --save-exact and one without—then update dependencies with npm update.
Explore npm scripts, including default npm start and npm test, and learn to add a start script in package.json to run node files like server.js.
Add a press start script that runs before npm start, install the colors package, require it in src/press start js, and print a green console.log message saying application is starting.
Learn to solve the npm prestart challenge by installing the colors package, creating a prestart script, and coloring console outputs in Node.js using either string prototype modification or colors/save.
Install npm-run-all as a development dependency, add an all script to package.json, and run npm run all --parallel to execute start, custom one, and custom two in parallel.
Install npm as dev dependency and use all script with parallel to run start, custom one, and custom two; switch to serial to run them sequentially and observe mixed results.
Explore how npm scripts use the package.json bin field to create executable files in the dot bin folder, explain shebang lines, and demonstrate running scripts like npm run all.
Explore how npm run all executes the bin folder script by launching the Node interpreter via env, showing path usage and cross-platform file handling on macOS and Windows.
In this course I will explain you what is NPM and how it is used.
This course is designed to provide students with a comprehensive understanding of NPM, the Node.js package manager. Students will learn how to use NPM to manage Node.js packages and create their own packages.
The course begins with an overview of NPM and its role in the Node.js ecosystem. Students will learn how to install and configure NPM, including setting up a new Node.js project and managing project dependencies using NPM.
The course then dives into more advanced NPM features, including package versioning and semantic versioning.
Throughout the course, students will gain hands-on experience working with NPM through a series of practical exercises and labs. By the end of the course, students will have a solid understanding of NPM and be able to effectively manage Node.js packages in real-world scenarios.
Learning Objectives:
Understand NPM and its role in the Node.js ecosystem
Install and configure NPM and create a new Node.js project
Manage project dependencies using NPM
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.
I will explain you what is the purpose of the NPM scripts and how they should be used. We will talk about built-in NPM scripts and 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. I will explain you what is shebang line and how it is used on the Unix-based system and on Windows.
After this course you will gain a deep knowledge about NPM and learn how to use it on practice.