asma-678-currency-convarter
v1.0.0
Published
This is only simple currency convater cli based
Readme
ASMA CURRENCY CODE
=============================
ASMA CURRENCY CODE
Currency Converter CLI
=============================A simple command line currency converter built with TypeScript and Inquirer.
Features
- Interactive prompts for the source currency, target currency and amount
- Supports USD, EUR, GBP, INR and PKR
- Rates are based on 1 USD
- Runs instantly, no browser needed
Requirements
- Node.js 20 or above (uses the built-in
fetch)
How to run
Run it directly from npm:
npx asma-currensy-codeOr run it from this folder:
node index.tsHow it works
All rates are stored against 1 USD, so the conversion happens in two steps:
- The given amount is divided by the source rate to get its USD value
- That USD value is multiplied by the target rate to get the answer
For example, 100 EUR to PKR:
100 / 0.91 = 109.89 USD
109.89 * 280 = 30769 PKRProject structure
| File | Purpose |
|---|---|
| index.ts | The whole converter, rates and prompts |
| package.json | Project info and dependencies |
Author
Asma Akbar
License
MIT
