GithubHelp home page GithubHelp logo

toefungi / exchange-rates-as-promised Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 4.0 596 KB

Promise based client for the Exchange Rates API which allows for current and historical exchange rate data for free

Home Page: https://exchangeratesapi.io/

License: MIT License

TypeScript 95.15% JavaScript 4.85%
api-client promises client library api exchange-rates currencies rates chaining

exchange-rates-as-promised's People

Contributors

dependabot[bot] avatar toefungi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

exchange-rates-as-promised's Issues

Usage via NPM doesn't work

Hi, I was searching for an exchange rate library, found yours and tried it out. But it seems this library is not meant to be used via NPM. My project is in typescript, but when I try to import { ExchangeRate, Currencies, ExchangeResponse } from 'exchange-rates-as-promised'; it doesn't find the module. Also your readme was written like it was meant to be used not from node_modules, but directly by using the source folder.

I haven't done NPM modules, so I'm not sure what you would need to do to make it work, but here's what I did to make it work:

  1. I ran npm add exchange-rates-as-promised, and installed the package in the node_modules.
  2. I went to folder node_modules/exchange-rates-as-promised and ran npm install and npm run build to build the index.js file into build directory.
  3. I edited your package.json and changed main to point to build/index.js.

After those operations the module was found, and typing support was enabled also in VSCode, and I was able to use your package :)

I hope you can update this and make it easier to use. It's a very handy package!

Newest 1.0.10 doesn't work via NPM package

Hi,

I just updated your package from v1.0.4 -> v1.0.10, but now when I try to create a new ExchangeRate object, it throws the following exception:
TypeError: exchange_rates_as_promised_1.ExchangeRate is not a constructor

I'm using it like this:

import { ExchangeRate, Currencies } from 'exchange-rates-as-promised';
const exchangeRate = new ExchangeRate();
...

Same code worked on 1.0.4. Based on your docs or commit history, I didn't see any changes on how it should be used, so I suspect the issue is with the NPM package you create.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.