ericblade / mws-simple

nodejs Amazon MWS (Merchant Web Services) API in ~150 lines of code
MIT License
8 stars 5 forks source link

Use Promises as an alternative to callbacks #21

Closed alexis-de-la-torre closed 5 years ago

alexis-de-la-torre commented 6 years ago

I just started a project that can will use this library a lot but it uses Promises and not callbacks. I will get to work on making it the library return a Promise when no Callback is given.

ericblade commented 6 years ago

great! :) i've already messed with the internals of this quite a bit since I forked it, I didn't want to do a lot of work to re-do more of it, since it's easy enough to just wrap it in a promisify wrapper. I'd be happy to entertain a pull req, though.

ericblade commented 6 years ago

@Alexis-De-La-Torre I just got a bit bored, couldn't sleep, and decided to extend it out to 150 lines, clean up the organization, make it a lot more readable. Check out v3, and you shouldn't have any problem with making it use Promises. :-)

avrtau commented 5 years ago

@ericblade I have made a pull request that adds Promise to the request method.

ericblade commented 5 years ago

this has been merged, thanks @avrtau