Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Node.js

First Node.js Program

Write and run your first Node.js script with console.log using the node command.

First Node.js Program — 5/55 in the Node.js series. Full playlist companion: Node.js complete course on YouTube. Prefer one article? Read the complete Node.js tutorial.

Short description

Create a `.js` file, write JavaScript, and run it with `node filename.js`. No browser is required.

Steps

  1. Create app.js.
  2. Add a simple console message.
  3. Run it with Node from the terminal.

app.js

const name = 'Imtiyaj';
console.log(`Hello, ${name}! Welcome to Node.js`);

// Run: node app.js

Leave a reply

Your email address will not be published. Required fields are marked *