Created
September 11, 2017 14:23
-
-
Save joduplessis/94de307a48e7f761b4409bad67a298eb to your computer and use it in GitHub Desktop.
Node boilerplate/example for receiving input from the console in a recursive manner.
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
#! /usr/bin/env node | |
// Resume our input from the console | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
// Receive some data | |
process.stdin.on('data', function (text) { | |
// Split the string arguments | |
const receivedInputArguments = text.replace(/\n$/, '').split(' '); | |
// Do any execution here | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment