Hi! The goal of the repository is to provide the nodejs crud operations by using command line arguments and storing data into the json file by using file systems.
"chalk": "^3.0.0", "yargs": "^15.1.0"
Chalk comes with an easy to use composable API where you just chain and nest the styles you want. For documentation follow documentation.
Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. For documentation follow documentation.
You can perform the crud operations through command line args. 1. create note
node app.js add --title="Note Create" --body="Note body created"
In the above command ** app.js** is the entry file, add is the event, --title is the title of the note, --body is the body of the note.
2. read note
node app.js read --title="Note Create"
In the above command ** app.js** is the entry file, **read ** is the event, --title is the title of the note considering as unique.
3. update note
node app.js update --title="Note Create" --updatedTitle="Note Title Updated" --updatedBody="Note Body Updated"
In the above command ** app.js** is the entry file, **update ** is the event, --title is the title of the note considering as unique and updatedTitle and updatedBody are two optional parameters to be updated to the field of the note title and body respectively.
4. delete note
node app.js remove --title="Note Title Updated"
In the above command ** app.js** is the entry file, **remove ** is the event, --title is the title of the note considering as unique. It will remove the note item where title will be matched.
5. list of notes
node app.js list
In the above command ** app.js** is the entry file, list is the event. It will retrieve all the notes present in the file.
Happy Coding