Skip to content

Instantly share code, notes, and snippets.

@ArataKagan
Created November 5, 2018 01:21
Show Gist options
  • Save ArataKagan/6f16c2e13d711f884aa8e985507d509f to your computer and use it in GitHub Desktop.
Save ArataKagan/6f16c2e13d711f884aa8e985507d509f to your computer and use it in GitHub Desktop.
const commands = require('./commands.js');
//prompt the user for input
process.stdout.write('prompt > ');
// the stdin 'data' event triggers after a user types in a line
process.stdin.on('data', (userInput) => {
userInput = userInput.toString().trim();
commands.evaluateCmd(userInput);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment