A simple ToDo program which allows user to perform specific operations related to tasks i.e:
- Add
- Update
- Delete
- Mark as done
- Mark as undone
- Show all tasks
Syntax: add <task_description>
node index.js add "Buy groceries"
Syntax: update <task_sr_no> <updated_task_description>
node index.js update 2 "Exercise for 30mins"
Syntax: delete <task_sr_no>
node index.js delete 1
Syntax: done <task_sr_no>
node index.js done 3
Syntax: undone <task_sr_no>
node index.js undone 3
Syntax: show
node index.js show
Follow these steps to set up the To-Do CLI application on your local machine.
Before installing and running this project, make sure you have the following installed on your system:
- Node.js (v14 or above recommended)
- npm (comes bundled with Node.js)
git clone https://github.com/raghavruia-dev/todo-cli.git
cd todo-cli
npm install
This will install all required packages listed in
package.json
, with the package version as specified inpackage-lock.json
.
node index.js add "Buy groceries"
Refer to the CLI Commands section for all available operations.
After installation you can run the commands as specified above or even use the below command to understand the commands better
node index.js help
- Built on JavaScript with node.js as runtime environment
- Commander.js to build CLI Interface
- Improve error handling, by creation of JSON file if not present.
- Improve readability by implementing async await function logic.
- Implementing delete all tasks command with an option to retrieve recently deleted tasks by maintaining a backup.