codegurukool.com · Free coding tutorials & online compiler

Home › Node.js Tutorial › Node.js NPM and package.json

Node.js NPM and package.json

Install and manage packages.

npm init -y creates a package.json file. npm install adds packages, and scripts such as npm start run commands you define.

Example code

const pkg = { name: "my-app", version: "1.0.0", scripts: { start: "node app.js" } };
console.log(pkg.name + "@" + pkg.version);

Run this code in the online editor

← Node.js processNode.js Express basics →