Require an API

Example : Reading user input

const readline = require('readline'); //Read Line API Call

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.question('Enter your name ', (answer) => {
  console.log(`Hello ${answer} , Welcome to node JS`);

  rl.close();
});

List of API’s Below

Node JS API’s of node Js : https://nodejs.org/api/index.html

Leave a Comment