1.0.0 • Published 2 years ago

todo-app-commander v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Exercise 3 - Node.js, CLI

Time for task #3!

In this section you will practice

Node.js - Build your first node.js cli app Npm - Work with external libraries Files - Read and write from the file system

What you are going to build

We already have a beautiful todo app that will help us to catch all the pokemons. Now let's create cli tool, so we can add, delete, and view todos like a real pro 👩‍💻 🧑‍💻

Use your code from the last exercise and refactor where needed.

The requirements:

  • v Build node.js cli todo app
  • v Detailed help option
  • v Read/Write/Delete todos from a file

When you finish it should look like this:

npm.io

Bonus

  • Publish your code as npm package and run it with npx
  • v Add colors to your cli tool
  • v Add Inquirer.js and make you cli tool interactive
  • v Display pokemon image (ascii art)

Run with npx

Install the package globally:

npm install -g todo-app-commander

Run:

npx todo-app-commander

Run with options

OptionDescription
-V, --versionOutput the version number
-h, --helpDisplay help for command
get optionsDisplays the todo list
add Write your todos or pokemons to the todo list
delete Delete a single todo by index
delete-pokemon Delete a single pokemon todo by pokemon ID or name
delete-not-foundDelete all not found pokemons todos
delete-all optionsDelete all todos by group type
pending-tasksShow your pending tasks
interactiveUse interactive menu
help commanddisplay help for command

Run Interactive

npx todo-app-commander interactive