There's a simpler way that easier to write!
To get started, we need to install a few dependencies:
npm install -g interactive-script async-to-gen minimist
Now let's write
var interactiveScript = ;var minimist = ;
You're given two functions:
- Print to the screen with
- Prompt and wait for a response with
Let's run this script:
$> async-node myScript.js --pirateAvast, me hearty!Whats ye name? LeeHI THERE: LEE$>
Tastes great with:
minimist: Read the arguments provided to your script from the terminal.
colors: Ask and say things in a rainbow of colors for better legibility.