ecb-currency-converterdeprecated

Convert currencies using data from the European Central Bank.

Usage no npm install needed!

<script type="module">
  import ecbCurrencyConverter from 'https://cdn.skypack.dev/ecb-currency-converter';
</script>

README

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