Week 3: Day 2
Section 12: Intro to Node, Mongo, & REST APIs
Tutorial 105: Node Modules
In this tutorial video, we are going to learn about npm(node package manager). npm is the package manager for the Node JavaScript platform. It puts modules in place so that nodes can find them, and manages dependency conflicts intelligently. It is extremely configurable to support a wide variety of use cases. Most commonly, it is used to publish, discover, install, and develop node programs. It allows you to install packages in javascript that are very powerful.
npm install downloads a package and it's dependencies. npm install can be run with or without arguments. When run without arguments, npm install downloads dependencies defined in a package. json file and generates a node_modules folder with the installed modules.
Why do we need npm?
NPM is a node package manager. It is basically used for managing dependencies of various server-side dependencies. We can manage our server-side dependencies manually as well but once our project's dependencies grow it becomes difficult to install and manage.
var rs = required(‘package-name’) is used to import and use a node package or an external module for node.
Node.js makes it possible to write applications in JavaScript on the server. It’s built on the V8 JavaScript runtime and written in C++ — so it’s fast. Originally, it was intended as a server environment for applications, but developers started using it to create tools to aid them in local task automation. Since then, a whole new ecosystem of Node-based tools (such as Grunt, Gulp, and webpack) has evolved to transform the face of front-end development.
To make use of these tools (or packages) in Node.js, we need to be able to install and manage them in a useful way. This is where npm, the Node package manager, comes in. It installs the packages you want to use and provides an interface to work with them.
Here's a brief list of some of the commonly used npm aliases:
npm i 'package': install local package.
npm i -g 'package' : install a global package.
npm un 'package' : uninstall local package.
npm up: npm update packages.
npm t: run tests.
npm ls: list installed modules.
Full Stack Web Development in Just 3 weeks
Published by WB Web, Under free promotions,
Watch All the videos for free for limited time.
You can buy the course from Udemy for lifetime access.
Udemy Course Link:
https://www.udemy.com/ultimate-web/
Content Credit: Mark Price
https://www.devslopes.com/
Hosted By
WB Web Development Solutions
Watch video 105. Node Modules online without registration, duration hours minute second in high quality. This video was added by user WB Web Development Solutions 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 6,06 once and liked it 5 people.