MOAR APIs
Reusable code
Open Source Software
IoT Integrations
Makes code portable
Makes code portable
Manages dependancies (libraries you need to run your app)
Makes code portable
Manages dependancies (libraries you need to run your app)
Keeps project metadata consistent
Makes code portable
Manages dependancies (libraries you need to run your app)
Keeps project metadata consistent
Access thousands of packages, so you don't have to reinvent the wheel
Makes code portable
Manages dependancies (libraries you need to run your app)
Keeps project metadata consistent
Access thousands of packages, so you don't have to reinvent the wheel
Consistent interface allows easy deployment
Makes code portable
Manages dependancies (libraries you need to run your app)
Keeps project metadata consistent
Access thousands of packages, so you don't have to reinvent the wheel
Consistent interface allows easy deployment
Part of a 12-factor app, and a balanced breakfast
$ npm init
Walks you through creating a package.json file
{
"name": "node_example",
"version": "1.0.0",
"description": "This is an example project",
"main": "app.js",
"scripts": {
"start" : "node app.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"request": "^2.67.0"
}
}
{
"scripts": {
"start" : "node app.js"
}
}
$ npm start
To run your node program:
Set by this field in package.json
Now every node program is started the same way, even if you name your files differently!
"dependencies": {
"request": "^2.67.0"
}
$ npm install
This command:
Installs each package in this field in package.json
$ npm install module-name --save
This command:
Installs new modules, then saves them in package.json