Loading lesson path
NPM scripts are commands you define in your package.json file to automate tasks like:
They make it easy to manage common tasks with simple commands. Defining Scripts in package.json Inside package.json, the scripts section lets you name and define commands:
{
"scripts": {
"start": "node index.js",
"test": "echo \"Running tests...\" && exit 0",
"dev": "nodemon index.js"
}
}Formula
Each script can be run from the command line using npm run < script - name >.To run a script, use: npm run dev For the special start script, you can just use: npm start
npm test
NPM scripts help automate and simplify project tasks. Define them in package.json and run them easily with npm.