Create an interactive terminal cli with node

Let’s create a tool that will track our some text entries.

Step 1: Create a new npm project and install the necessary libraries

$ mkdir my_cli && cd my_cli && npm init -y && npm i --save inquirer chalk

chalk – helps color the terminal prompts

inquirer – makes creating interactive prompts a breeze

Step 2: create interactive terminal prompts

[gist /]

Step 3: save or append to a file (did.txt)

[gist /]

Full code here

Leave a Reply

Your email address will not be published. Required fields are marked *