Skip to content

Instantly share code, notes, and snippets.

@WeltonThomasFerreira
Created May 23, 2022 11:45
Show Gist options
  • Save WeltonThomasFerreira/bc2dfea7e45f638fb93f1e5c531c70e5 to your computer and use it in GitHub Desktop.
Save WeltonThomasFerreira/bc2dfea7e45f638fb93f1e5c531c70e5 to your computer and use it in GitHub Desktop.
I/O Node 18
// node: v18.2.0
import * as readline from 'node:readline/promises';
import { stdin as input, stdout as output } from 'node:process';
const rl = readline.createInterface({ input, output });
const answer = await rl.question('What do you think of Node.js? ');
rl.write(answer + "\n")
rl.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment