- Used TypeScript instead of JavaScript because it is more maintainable.
- Input the transactions from the CSV file and filter them depending on the user's input(s)
- External inputs such as the CLI input date, the CSV data, and the Crypto Compare API response are validated with Zod. This provides true type safety.
- To fetch as less as possible, the USD exchange rates are fetched only once for each unique token.
- Used maps instead of objects because they are easier to set and get. Map is also iterable and fast.
- Added Jest tests for each utility file because tests improve maintainability.
- Added linting with ESLint because it helps find and fix code problems.
- Added code formatting with Prettier because it enforces the same code format across the entire project.
- Used pnpm instead of npm because it is faster and stricter.
npm i -g pnpm
pnpm i
pnpm build
- Create a
.env
file and addCRYPTO_COMPARE_API_KEY
- Run
pnpm start
orpnpm start --token <token>
orpnpm start --date <date>
or add both options