Skip to content

Instantly share code, notes, and snippets.

@jes
Created September 27, 2022 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jes/ce5bae65259b18c47fb457af202a9591 to your computer and use it in GitHub Desktop.
Save jes/ce5bae65259b18c47fb457af202a9591 to your computer and use it in GitHub Desktop.
$ cat app.ts
const rl = require('readline').createInterface({
input: process.stdin,
});
rl.on('line', (n: number) => {
const m = n + 1;
console.log(`m = ${m}`);
});
$ ts-node app.ts
1
m = 11
2
m = 21
3
m = 31
fsdafjasdfasd
m = fsdafjasdfasd1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment