simple-courses-manager
v1.1.0
Published
A simple, interactive command-line application for managing your courses with persistent JSON storage.
Downloads
185
Readme
Course Manager CLI
A simple, interactive command-line application for managing your courses with persistent JSON storage.
✨ Features
- Add Courses - Interactive prompts to add new courses with title and price
- Persistent Storage - Courses are saved to
courses.json - Interactive CLI - User-friendly command-line interface
- Auto-reload - Development mode with Nodemon for quick iteration
🚀 Quick Start
Prerequisites
- Node.js (v14 or higher)
- npm (comes with Node.js)
Installation
npm installRunning the Application
npm run indexThis will start the Course Manager CLI with auto-reload enabled.
📝 Usage
Once the application is running, use the following commands:
Add a Course
add
# or use the alias
aYou'll be prompted to enter:
- Course Title: Name of the course
- Course Price: Price as a number
The course will be saved to courses.json.
Example Session
$ npm run index
> nodemon index
Course Manager v1.1
add - Add a course
a - Add a course (alias)
? select-command: add
? Course title: JavaScript Basics
? Course price: 49.99
Add course done!📦 Project Structure
CLI/
├── index.js # Main CLI application
├── courses.json # Course data storage (auto-generated)
├── package.json # Project dependencies and scripts
└── README.md # This file🛠️ Dependencies
- commander (v14.0.3) - CLI framework for command parsing
- inquirer (v13.3.2) - Interactive command-line prompts
- nodemon (v3.1.14, dev) - Auto-reload during development
🔧 npm Scripts
| Script | Purpose |
|--------|---------|
| npm run index | Run the app with Nodemon (development) |
| npm test | Test runner (not yet configured) |
📊 Data Format
Courses are stored in courses.json as a JSON array:
[
{
"title": "JavaScript Basics",
"price": 49.99
},
{
"title": "React Advanced",
"price": 79.99
}
]💡 How It Works
- Commander parses CLI commands and options
- Inquirer displays interactive prompts for user input
- Node.js fs module handles file operations (read/write)
- JSON stores and retrieves course data persistently
🎯 Future Enhancements
- View all courses
- Delete a course
- Update course information
- Filter courses by price range
- Export to CSV
- Database integration
📄 License
ISC
Happy Learning! 🚀
