Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

multiple question node js

'use strict'

const readline = require('readline')

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

const question1 = () => {
  return new Promise((resolve, reject) => {
    rl.question('q1 What do you think of Node.js? ', (answer) => {
      console.log(`Thank you for your valuable feedback: ${answer}`)
      resolve()
    })
  })
}

const question2 = () => {
  return new Promise((resolve, reject) => {
    rl.question('q2 What do you think of Node.js? ', (answer) => {
      console.log(`Thank you for your valuable feedback: ${answer}`)
      resolve()
    })
  })
}

const main = async () => {
  await question1()
  await question2()
  rl.close()
}

main()
Comment

PREVIOUS NEXT
Code Example
Javascript :: react router 6 redirect 
Javascript :: check if value in mapping is empty struct in solidity ethereum 
Javascript :: js check if field in database is true or false 
Javascript :: requiere and get a property simplified with Node 
Javascript :: jitsi npm ERR! code EINTEGRITY npm ERR! sha512-VYzZHHs 
Javascript :: get day in google app script 
Javascript :: add grepper code 
Javascript :: how create a random enum on postman variable 
Javascript :: Logical Assignment Operator null coalescing 
Javascript :: how to replace multiple characters in url in jqury 
Javascript :: Decimal Base Exponent shorthand javascript 
Javascript :: javascript findindex para objeto json 
Javascript :: chrome extension get current tab 
Javascript :: ContentDocumentLink example in jS 
Javascript :: key html 
Javascript :: set value as object in react hooks 
Javascript :: vue get key inside component 
Javascript :: resource route or crud routs 
Javascript :: javascript ignore a function if viewed in mobile 
Javascript :: react native set src absolute path 
Javascript :: javascript activate file input 
Javascript :: add textbox data to table html and javascript 
Javascript :: javascirpt escape tab 
Javascript :: javascript returns odd 
Javascript :: Get characters between two characters 
Javascript :: observables loop in template angular 8 
Javascript :: Spread syntax in ES6 
Javascript :: import * as stringFunctions from "./string_functions.js"; // add code above this line stringFunctions.uppercaseString("hello"); stringFunctions.lowercaseString("WORLD!"); 
Javascript :: tampermonkey all pages 
Javascript :: header fetch as string 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =