Skip to content

Instantly share code, notes, and snippets.

@stuymedova
Created August 22, 2023 21:22
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 stuymedova/410b67626c109f463eecd5bc387068de to your computer and use it in GitHub Desktop.
Save stuymedova/410b67626c109f463eecd5bc387068de to your computer and use it in GitHub Desktop.
// Node.js
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.on('line', (input) => {
if (input === 'ping') {
rl.write('pong\n');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment