Our game should interact with the user in 2 ways. It should know how to accept the keyboard input,
and it should know how to print messages to the console.
You’re already familiar with console.log, but this time I suggest using an npm module terminal-kit
.
It will provide us with all we need for the task, plus a couple of very handy utility functions that will
allow us to change our position on the screen, clear the screen and handle user input.
- Start by installing it by running
npm install --save terminal-kit
in the terminal. - Create a new file constants.js and place the line
import terminalKit from 'terminal-kit';
in it. - After importing the module, add the line
export const term = terminalKit.terminal;
.
This task is part of the Full-Stack JavaScript Course.
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.