0.0.5 ā€¢ Published 3 years ago

udemonia-to-do v0.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Simple Command Line Tool For Tasks

This is a simple, local storage CLI for quick to-dos. The data is stored locally in a JSON file

npm.io

npm download

> npm i udemonia-to-do

For NPM package use after installing the NPM package

$ touch cli.js

In the cli.js file, require the package

const toDoCLI = require('udemonia-to-do')

The basic data structure of a to-do

[
  {
    "name": "Example Task",
    "dateAdded": "2021-06-08",
    "notes": "Example Notes - things to keep in mind",
    "completed": false,
    "dateCompleted": null
  }
]

Basic To Do Commands

Add a new to-do

> node cli.js new

You will be prompted for the name of the task and any notes you'd want to add

$ node cli.js new
? To Do
? Notes

Notes default to an empty string if you press enter without adding notes

You can also skip the 'To Do' prompt by adding the name after the new command

> node cli.js new My Task Title

Find all non-completed to-dos and mark them completed

> node cli.js new mc

note: this will update the completed to true while adding today's date as the date completed

[
  {
    "name": "Example Task",
    "dateAdded": "2021-06-08",
    "notes": "Example Notes - things to keep in mind",
    "completed": true,
    "dateCompleted": "2021-08-08"
  }
]

View all open to-dos

> node cli.js lo

View all completed to-dos

> node cli.js lc

Help

> node cli.js help
šŸ˜€ $node cli.js help
Usage: cli [options] [command]

to-do-cli

Options:
  -V, --version     output the version number
  -h, --help        display help for command

Commands:
  new|n             Add a new task to the list
  markComplete|mc   Mark a task as completed! āœ…
  listAll|la        List all the tasks (open & completed)
  listCompleted|lc  List all of the completed tasks āœ…
  listOpen|lo       List all the open tasks āŒ
  help [command]    display help for command

~/.bash_profile alias

You can add an alias to your .bash_profile and run the alias from any directory

e.g.

Get the present working directory

> pwd

copy the present working directory, open vim or any other text editor and paste it inside the bash shell alias

> vim ~/.bash_profile

alias task='node /Users/my-path-to-download/to-do-cli

Once saved, open a new terminal session and any of the commands above can be ran from any directory with the alias

e.g.

> task new my task title
0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago