leadstoloyals / node-agcod

Node.js api for the Amazon Gift Codes On Demand Web Services
5 stars 7 forks source link

Update index.js #4

Open BlackFenix2 opened 3 years ago

BlackFenix2 commented 3 years ago

Quick update to fix the package crashing as mentioned in https://github.com/leadstoloyals/node-agcod/issues/3

christiaanwesterbeek commented 3 years ago

I'm not sure why you get the error, because let x = new BigNumber(123.4567) (or BigNumber(123.4567)) is supposed to be the way to create the number according to the docs.

It's probably related to a combination of the way the Bignumber repo was setup and your js-bundler. More people reported the problem.

I'm not sure if your fix is introducing a problem with other bundlers...

BlackFenix2 commented 3 years ago

@christiaanwesterbeek I noticed you dont have a LICENSE.MD in your repo, can i fork this project and just work off that? i have to use async/await in my workspace.

christiaanwesterbeek commented 3 years ago

I'm fine with that. We can also consider to bring you modernisations back to this repo afterwards and create a 2.x version if it's incompatible with the current 1.x.

BlackFenix2 commented 3 years ago

@christiaanwesterbeek yeah, this project uses the depreciated request NPM package. i can modernize by switching to axios for http requests.

BlackFenix2 commented 3 years ago

@christiaanwesterbeek i completed my PR and added a createGiftCardAsync() method to allow promise-based API access through axios.

it should not require a major version change since i just added an API endpoint without breaking the existing API. let me know iif you need anything else.

christiaanwesterbeek commented 3 years ago

It looks backward compatible, and if you had the same experience. I think I can merge this one in and release a 1.1 on npm which is a minor version increment.

BlackFenix2 commented 3 years ago

@christiaanwesterbeek sounds good, when can we publish the minor version to NPM?