Skip to content

magicaltrip/fixer.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fixer.io

A small typescript wrapper for https://fixer.io/.

Installation

yarn add @magicaltrip/fixer.io --save --exact

Usage

Sandbox mode

import * as FixerIo from "@magicaltrip/fixer.io";

const fixerIo = FixerIo.sandbox();

fixerIo
  .latest({ base: "EUR" })
  .then(console.log)
  .catch(console.error);

Live mode

import fetch from "node-fetch";
import * as FixerIo from "@magicaltrip/fixer.io";

const cache = FixerIo.InMemoryCache.make({
  cacheTTLInSeconds: 8 * 60 * 60 // cache for 8 hours
});

const fixerIo = FixerIo.live({
  apiUrl: String(process.env.FIXER_IO_API_URI), // use your own env variables
  apiKey: String(process.env.FIXER_IO_API_KEY), // use your own env variables
  fetch,
  cache
});

fixerIo
  .latest({ base: "JPY" })
  .then(console.log)
  .catch(console.error);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published