💡NPM (Node Package Manager)
Install NPM: NPM is installed with Node.js. So just you have to install Node.js
To install NPM packages:
npm init: It will create a package.json file.
Note: This command should run on your root directory i.e your entry point of the project.
- package.json: The use of this file is that the packages we are installing using NPM will store in it as dependencies. It just contains the package name and its version.
Syntax: npm install <package_name>
* npm install passport
Note: When we install any module 1st time using NPM, it will create a file and folder called package-lock.json(file) and node_modules(folder)
1. package-lock.json - It contains detailed information about packages/modules which are installed in package.json as dependencies
2. node_modules: node_modules folder will contain the files. They will contain the actual code of all installed dependencies. Just you have to require these dependencies in your project and use them.
const passport = require('passport');
Done! ✌ Now only you have to install the required packages which are required for your project.