
npm install @ehdlg/expense-trackerThis project is a simple CLI tool for managing your expenses, created as part of the roadmap.sh expense-tracker project. The goal of this project is to learn how to use commander to create CLI applications in TypeScript, while also refreshing concepts in Node.js such as file reading and writing. The application stores expense data in a JSON file and allows for various operations on these expenses.
- Add an Expense: Easily add a new expense with a description and amount.
- Update an Expense: Modify the details of an existing expense.
- Delete an Expense: Remove an expense by its ID.
- List Expenses: View all the expenses that have been added.
- Summary of Expenses: Get a summary of all expenses or filter by a specific month and/or year.
- JSON Storage: Expenses are stored in a JSON file, allowing for simple data management.
- Categories and Budgeting (Upcoming Features): Set budgets and filter expenses by category.
- Export to CSV (Upcoming Feature): Export your expenses to a CSV file.
You can install the CLI tool globally using npm:
``bash`
npm i -g @ehdlg/expense-tracker
Once installed, you can use the following commands:
Usage: expense-tracker [command] [options]
Commands:
- add [options] Add a new expense
- delete [options] Delete an existing expense
- update [options] Update an existing expense
- list List all the expenses
- summary [options] Gives information about the global expenses or the expenses of a sepecific month and/or year
- help [command] Display help for command
`bash`
expense-tracker add --description "Lunch" --amount 15
`bash`
expense-tracker update --id 1 --description "Dinner" --amount 20
`bash`
expense-tracker list
`bash`
expense-tracker summary
`bash``
expense-tracker summary -m 8 -y 2023
- Commander.js: Learn how to use commander to build powerful CLI tools.
- TypeScript: Practice using TypeScript for Node.js applications.
- File Operations: Refresh knowledge on file handling in Node.js by reading and writing JSON data.
- NPM Publishing: Package and publish the CLI tool to npm.
- Expense Categories: Allow filtering expenses by category.
- Budget Management: Set and track monthly budgets with warnings for overages.
- CSV Export: Enable exporting expense data to CSV files.
- SQLite as database: Using SQLite for more robust data storage.