how to get started with nodejs

JavaScript
const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});// Run this command in your terminal to start your node application.
// Replace the tag with your applications main file name (ex index.js, main.js etc). 
// Add alternative a relative or absolute path before the name.

node <filename>.jsconst inNode = new Function('try{return this===global;}catch(err){return false;}')();
Source

Also in JavaScript: