Gathering detailed insights and metrics for request-promise-core
Gathering detailed insights and metrics for request-promise-core
Gathering detailed insights and metrics for request-promise-core
Gathering detailed insights and metrics for request-promise-core
Core Promise support implementation for the simplified HTTP request client 'request'.
npm install request-promise-core
61.6
Supply Chain
93
Quality
71.8
Maintenance
50
Vulnerability
97.3
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
19 Stars
58 Commits
43 Forks
4 Watching
3 Branches
7 Contributors
Updated on 10 May 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
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
1
1
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.
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.
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 });
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.
To set up your development environment:
cd
to the main folder,npm install
,npm install gulp -g
if you haven't installed gulp globally yet, andgulp dev
. (Or run node ./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.
lodash
to ^4.17.19
following this advisory.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.)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.)constructorMixin
option to enable request/request-promise#123request-promise@3.0.0
transform2xxOnly
option (fixes request/request-promise#131)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
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
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
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