CurrencyConversion is a command-line application written in Node.js that allows users to convert monetary values between different currencies. The application follows the requirements and functionality outlined below:
- Input Format: Accepts a command-line argument for the date in the format 'YYYY-MM-DD'.
- Multiple Conversions: Capable of processing multiple currency conversions in a single session.
- Continuous Validation: Continuously validates all inputs until correct ones are provided. Monetary values are constrained to two decimal places, and currencies must be in ISO 4217 three-letter currency code format.
- Case Insensitivity: The application is case-insensitive.
- Caching: Caches exchange rates for each requested base currency. Subsequent conversions with the same base currency utilize cached data instead of calling the API.
- Output Saving: Saves each successful conversion in a JSON file.
- Termination: Terminates the application upon typing
END
on any input. - API Key Configuration: Loads the API key for Fast Forex from
config.json
.
- Installation: Ensure Node.js is installed on your system.
- Configuration: Add your Fast Forex API key to the
config.json
file. - Execution: Run
node CurrencyConversion.js
followed by the desired date.