
Initialize your project with npm, understand the package.json file, and navigate semantic versioning. Distinguish dependencies from development dependencies, explore scripts, bin folders, and cross-platform executable scripts for Windows and Mac.
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.
Build a clock browser app with npm and moment.js, initializing clock package, deliver index.js with no modules that updates an h1 every second using moment.js formatting and console output.
Learn to build a clock browser app with npm and moment.js, wiring HTML, CSS, and JS to format time and update every second.
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.
Create a new project, install a previous version of a chosen package, verify the installed version by inspecting package.json and package-lock.json, then delete node_modules and run npm install to reinstall.
Reinstall an old npm package version without a lock file by creating a project, installing colors 1.1.0 as a dev dependency, and observe npm’s semver choosing the latest compatible release.
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.
Learn how to update project dependencies with npm by managing exact and caret versions for react and jquery, using npm update, and adjusting package.json for compatibility.
discover how npm scripts live in package.json and how to define, run, and chain built-in and custom scripts with &&, using the test example.
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.
Learn to create and run custom npm scripts with npm run, rename and organize scripts, and execute files in the src folder, including running multiple scripts in parallel.
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.
Explore how Windows handles npm scripts, including installing dependencies, revealing bin executables, and running scripts with npm run all using node, and compare with Mac behavior.
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.