t3chnoboy / amazon-product-api

:credit_card: Amazon Product Advertising API client
365 stars 104 forks source link

Add request option #50

Closed lassebunk closed 8 years ago

lassebunk commented 8 years ago

First of all, thanks for making this module. It works really great.

In my project, I throttle requests from different parts of the system to prevent overloading and being throttled by services like Amazon. For this I use the throttled-request module. This pull request makes it easy to pass a custom request function to be used when calling Amazon. This could also be used for using other libraries, as long as they conform to the interface of request.

Example:

var request = require('request');
var throttledRequest = require('throttled-request')(request);

client.itemSearch({
  request: throttledRequest
  // ...
});

Thanks, Lasse

FdezRomero commented 8 years ago

This would help to fix my issue #37 about including throttling functionality 👍

lassebunk commented 8 years ago

Sounds good, @FdezRomero :)

t3chnoboy commented 8 years ago

Looks good! Thank you!

shishircc commented 8 years ago

Hi @t3chnoboy ,

This is quite useful feature. Can you publish this to npm ?

t3chnoboy commented 8 years ago

hey @shishircc I just published 0.4.0!