Core Promise support implementation for the simplified HTTP request client 'request'.
Installations
npm install request-promise-core
Score
61.6
Supply Chain
93
Quality
71.8
Maintenance
50
Vulnerability
97.3
License
Releases
Unable to fetch releases
Developer
request
Developer Guide
Module System
CommonJS
Min. Node Version
>=0.10.0
Typescript Support
No
Node Version
10.21.0
NPM Version
6.14.4
Statistics
19 Stars
58 Commits
43 Forks
4 Watching
3 Branches
7 Contributors
Updated on 10 May 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
2,541,163,464
Last day
-9.7%
1,270,099
Compared to previous day
Last week
3.1%
8,261,951
Compared to previous week
Last month
59.2%
29,058,556
Compared to previous month
Last year
-23.2%
240,287,885
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Peer Dependencies
1
request-promise-core
This package is the core for the following packages:
request-promise-core
contains the core logic to add Promise support to request
.
Please use one of the libraries above. It is only recommended to use this library directly, if you have very specific requirements.
Installation for request@^2.34
This module is installed via npm:
npm install --save request
npm install --save request-promise-core
request
is defined as a peer-dependency and thus has to be installed separately.
Usage for request@^2.34
1// 1. Load the request library 2 3// Only use a direct require if you are 100% sure that: 4// - Your project does not use request directly. That is without the Promise capabilities by calling require('request'). 5// - Any of the installed libraries use request. 6// ...because Request's prototype will be patched in step 2. 7/* var request = require('request'); */ 8 9// Instead use: 10var stealthyRequire = require('stealthy-require'); 11var request = stealthyRequire(require.cache, function () { 12 return require('request'); 13}); 14 15 16// 2. Add Promise support to request 17 18var configure = require('request-promise-core/configure/request2'); 19 20configure({ 21 request: request, 22 // Pass your favorite ES6-compatible promise implementation 23 PromiseImpl: Promise, 24 // Expose all methods of the promise instance you want to call on the request(...) call 25 expose: [ 26 'then', // Allows to use request(...).then(...) 27 'catch', // Allows to use request(...).catch(...) 28 'promise' // Allows to use request(...).promise() which returns the promise instance 29 ], 30 // Optional: Pass a callback that is called within the Promise constructor 31 constructorMixin: function (resolve, reject) { 32 // `this` is the request object 33 // Additional arguments may be passed depending on the PromiseImpl used 34 } 35}); 36 37 38// 3. Use request with its promise capabilities 39 40// E.g. crawl a web page: 41request('http://www.google.com') 42 .then(function (htmlString) { 43 // Process html... 44 }) 45 .catch(function (err) { 46 // Crawling failed... 47 });
Installation and Usage for request@next
Request Next is still in alpha. However, request-promise-core
is already designed to be compatible and ships with a configuration helper – require('request-promise-core/configure/request-next')
– that is used by request-promise
in its "next" branch.
Contributing
To set up your development environment:
- clone the repo to your desktop,
- in the shell
cd
to the main folder, - hit
npm install
, - hit
npm install gulp -g
if you haven't installed gulp globally yet, and - run
gulp dev
. (Or runnode ./node_modules/.bin/gulp dev
if you don't want to install gulp globally.)
gulp dev
watches all source files and if you save some changes it will lint the code and execute all tests. The test coverage report can be viewed from ./coverage/lcov-report/index.html
.
If you want to debug a test you should use gulp test-without-coverage
to run all tests without obscuring the code by the test coverage instrumentation.
Change History
- 1.1.4 (2020-07-21)
- Security fix: bumped
lodash
to^4.17.19
following this advisory.
- Security fix: bumped
- 1.1.3 (2019-11-03)
- Security fix: bumped
lodash
to^4.17.15
. See vulnerabilty reports. (Thanks to @daniel-nagy for pull request #20 and thanks to @quetzaluz for reporting this in issue #21.)
- Security fix: bumped
- 1.1.2 (2019-02-14)
- Security fix: bumped
lodash
to^4.17.11
. See vulnerabilty reports. (Thanks to @lucaswillering and @sam-warren-finnair for reporting this in issues #12 and #13 and thanks to @Alec321 for pull request #14.)
- Security fix: bumped
- 1.1.1 (2016-08-08)
- 1.1.0 (2016-07-30)
- Added
constructorMixin
option to enable request/request-promise#123
- Added
- 1.0.0 (2016-07-15)
- All tests green, ready for prime time
- 1.0.0-rc.1 (2016-07-10)
- Reimplementation of core logic based on
request-promise@3.0.0
- Plus
transform2xxOnly
option (fixes request/request-promise#131)
- Reimplementation of core logic based on
License (ISC)
In case you never heard about the ISC license it is functionally equivalent to the MIT license.
See the LICENSE file for details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: ISC License: LICENSE:0
Reason
Found 2/28 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
3
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More