Created
April 28, 2019 09:14
-
-
Save picpoint/7cda9cd0cd24583e551dd72dcab1a326 to your computer and use it in GitHub Desktop.
simple code to IO in Nodejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stdin = process.stdin; | |
const stdout = process.stdout; | |
stdout.write('Enter you name -> '); | |
stdin.on('data', function (data) { | |
stdout.write('Your name is -> '); | |
var name = data.toString().trim(); | |
stdout.write(name + '\n'); | |
stdout.write('Your name to reverse -> ' + name.toString().split('').reverse().join('') + '\n'); | |
process.exit(); | |
}); | |
process.on('exit', function () { | |
stdout.write('App is completed\n'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment