To get started, just run
npm ci // Installs packages
npm run compile:watch // Compiles/Watches for changes/and runs
node dist/index.js // Run index.js in a different terminal window, can also be ran with nodemon or similar
To Deploy
GitHub actions is set up to deploy this package once the version is raised in package.json and pushed to main
The Commit message must have the version number in it, ex Release 1.0.2
// You can import individiually
import { Images, CurrencyCode, currencyNames } from '@keetanetwork/currency-info';
// Or you can import all exports together
import * as CurrencySVG from '@keetanetwork/currency-info';
/**
* Exported Types
*/
// CurrencyCode is a union string type that includes all currency names
CurrencySVG.CurrencyCode // 'USD' | 'EUR' | ... 'GBP'
/**
* Exported Data
*/
// currencyNames is an array of all currencyNames too
CurrencySVG.currencyNames // ['USD', 'EUR', ... 'GBP']
// Images is an object containing the CurrencyCode and the base64 svg data
CurrencySVG.Images
// {
// USD: 'data:image/svg+xml;base64,ADSKJH...',
// EUR: 'data:image/svg+xml;base64,ADSKJH...',
// ..........................................
// GBP: 'data:image/svg+xml;base64,ADSKJH...'
// }We use custom webpack loaders for .svg files, so you will not be able to run this outside of webpack
types.generated.ts is generated by webpack too, so you cannot compile the library without webpack
Svgs were taken from @hampusborgos/country-flags (Public Domain Licensed)