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);