1.0.0 • Published 6 years ago

ecb-currency-converter v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
6 years ago

ecb-currency-converter

Build Status Convert currencies using data from the European Central Bank.

Installation

With npm

npm install --save ecb-currency-converter

Documentation

Documentation is available here.

Example

Example of currency conversion

import {CurrencyConverter} from "../src";

// Create converter
let currencyConverter: CurrencyConverter = new CurrencyConverter();

currencyConverter

    // Convert from EUR to SEK
    .convert({
        from: "EUR",
        to: "SEK",
        quantity: 100
    })

    // Get results
    .then(result => {
        /*
         * Result is for example
         * {
         *     currency: 'SEK',
         *     quantity: 1019.22759
         * }
         */
    });

Contribute

Make sure to run the tests

npm test