Skip to content

Starting a Node.js project

Course: Node.js Runtime - chapter 3

To initialize a Node.js project locally,

  • Run the following command -
npm init -y
  • Exploring package.json

  • Writing some code

let firstName = "Harkirat Singh"
console.log(firstName)
  • Run the code
node index.js
  • Add a script in package.json
"scripts": {
"start": "node index.js"
},
  • Run npm run start