rp.js 531 B

123456789101112131415161718192021222324252627
  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;