A simple and elegant command-line application for managing notes.
Built using Node.js, with support from yargs
for argument parsing, chalk
for colored output, and native fs
for file operations.
- β Add new notes via terminal
- β Remove notes by title
- π List all notes in storage
- π Read a specific note
- π« Prevents duplicate titles
- πΎ Saves notes in
notes.json
file (local JSON DB)
node-course/
βββ notes-app/
β βββ app.js # Main CLI entry point (with yargs setup)
β βββ notes.js # Core logic for add, remove, list, read
β βββ notes.json # Stores all notes locally (acts as a DB)
β βββ utils.js # Optional utilities
β βββ package.json # Dependencies and metadata
β βββ node_modules/ # Installed npm packages
βββ playground/
β βββ 1-json.js
β βββ 1-json.json
β βββ 2-arrow-function.js
β βββ 3-arrow-challenge.js
npm install
node app.js <command> [options]
node app.js add --title="Shopping" --body="Buy milk and bread"
node app.js remove --title="Shopping"
node app.js list
node app.js read --title="Shopping"
Package | Purpose |
---|---|
yargs |
For parsing command-line arguments |
chalk |
For styled and colored terminal output |
Built-in fs |
Nodeβs file system module for reading and writing files |
The playground/
folder is used for practice and testing.
It contains:
- π JSON parsing examples (
1-json.js
,1-json.json
) - πΉ Arrow function challenges (
2-arrow-function.js
,3-arrow-challenge.js
)
These files are not part of the main app logic.
- Add note editing/updating feature
- Add timestamps for each note
- Export notes to
.txt
or.md
- Support tags or categories
π¬ This project is ideal for Node.js beginners practicing modules, JSON, command-line tools and basic file handling.