Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

typescript take user input from console

import * as readline from 'node:readline';
import { stdin, stdout } from 'process';

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

rl.question("What is your name? ", function (answer: string) {
  console.log(`Oh, so your name is ${answer}`);
  console.log("Closing the interface");
  rl.close();
});
Comment

PREVIOUS NEXT
Code Example
Typescript :: event typescript 
Typescript :: gets ents within range gmod lua 
Typescript :: node fetch exports is not defined 
Typescript :: vscode custom snippets multiple transform 
Typescript :: react native elements input limit 
Typescript :: adonis model use transaction 
Typescript :: how to set the contents of a div with jquery 
Typescript :: sts getting slow while pressing control key 
Typescript :: mat input datetime-local now 
Typescript :: requests python no proxy 
Typescript :: model has no objects member django 
Typescript :: rscript arguments input 
Typescript :: typescript type for jsx element 
Typescript :: ion input ngmodel not working ionic 6 
Typescript :: clickawaylistener material ui 
Typescript :: collapse all code vscode 
Typescript :: how to write a class with inputs in python 
Typescript :: print contents of cpp file 
Typescript :: vue3 backend django 
Typescript :: typescript check if element in array 
Typescript :: is id in array typescript 
Typescript :: react ts createcontext 
Typescript :: angular forkjoin 
Typescript :: capacitor base64 to file 
Typescript :: c# get amount of elements in enum 
Typescript :: nestjs casl 
Typescript :: communication between components in angular 
Typescript :: angular subscribe catch stat 
Typescript :: filter array of objects react 
Typescript :: typescript react dispatch 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =