rp.js 531 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. var configure = require('request-promise-core/configure/request2'),
  3. stealthyRequire = require('stealthy-require');
  4. // Load Request freshly - so that users can require an unaltered request instance!
  5. var request = stealthyRequire(require.cache, function () {
  6. return require('request');
  7. },
  8. function () {
  9. require('tough-cookie');
  10. }, module);
  11. configure({
  12. request: request,
  13. PromiseImpl: Promise,
  14. expose: [
  15. 'then',
  16. 'catch',
  17. 'promise'
  18. ]
  19. });
  20. module.exports = request;