class="name"> LV.json 11e3a9652a first 7 years ago LY.json 11e3a9652a first 7 years ago MA.json 11e3a9652a first 7 years ago MC.json 11e3a9652a first 7 years ago MD.json 11e3a9652a first 7 years ago ME.json 11e3a9652a first 7 years ago MG.json 11e3a9652a first 7 years ago MH.json 11e3a9652a first 7 years ago MK.json 11e3a9652a first 7 years ago ML.json 11e3a9652a first 7 years ago MM.json 11e3a9652a first 7 years ago MN.json 11e3a9652a first 7 years ago MO.json 11e3a9652a first 7 years ago MP.json 11e3a9652a first 7 years ago MQ.json 11e3a9652a first 7 years ago MR.json 11e3a9652a first 7 years ago MS.json 11e3a9652a first 7 years ago MT.json 11e3a9652a first 7 years ago MU.json 11e3a9652a first 7 years ago MV.json 11e3a9652a first 7 years ago MW.json 11e3a9652a first 7 years ago MX.json 11e3a9652a first 7 years ago MY.json 11e3a9652a first 7 years ago MZ.json 11e3a9652a first 7 years ago NA.json 11e3a9652a first 7 years ago NC.json 11e3a9652a first 7 years ago NE.json 11e3a9652a first 7 years ago NF.json 11e3a9652a first 7 years ago NG.json 11e3a9652a first 7 years ago NI.json 11e3a9652a first 7 years ago NL.json 11e3a9652a first 7 years ago NO.json 11e3a9652a first 7 years ago NP.json 11e3a9652a first 7 years ago NR.json 11e3a9652a first 7 years ago NU.json 11e3a9652a first 7 years ago NZ.json 11e3a9652a first 7 years ago OM.json 11e3a9652a first 7 years ago PA.json 11e3a9652a first 7 years ago PE.json 11e3a9652a first 7 years ago PF.json 11e3a9652a first 7 years ago PG.json 11e3a9652a first 7 years ago PH.json 11e3a9652a first 7 years ago PK.json 11e3a9652a first 7 years ago PL.json 11e3a9652a first 7 years ago PM.json 11e3a9652a first 7 years ago PN.json 11e3a9652a first 7 years ago PR.json 11e3a9652a first 7 years ago PS.json 11e3a9652a first 7 years ago PT.json 11e3a9652a first 7 years ago PW.json 11e3a9652a first 7 years ago PY.json 11e3a9652a first 7 years ago QA.json 11e3a9652a first 7 years ago RE.json 11e3a9652a first 7 years ago RO.json 11e3a9652a first 7 years ago RS.json 11e3a9652a first 7 years ago RU.json 11e3a9652a first 7 years ago RW.json 11e3a9652a first 7 years ago SA.json 11e3a9652a first 7 years ago SB.json 11e3a9652a first 7 years ago SC.json 11e3a9652a first 7 years ago SD.json 11e3a9652a first 7 years ago SE.json 11e3a9652a first 7 years ago SG.json 11e3a9652a first 7 years ago SH.json 11e3a9652a first 7 years ago SI.json 11e3a9652a first 7 years ago SK.json 11e3a9652a first 7 years ago SL.json 11e3a9652a first 7 years ago SM.json 11e3a9652a first 7 years ago SN.json 11e3a9652a first 7 years ago SO.json 11e3a9652a first 7 years ago SR.json 11e3a9652a first 7 years ago ST.json 11e3a9652a first 7 years ago SV.json 11e3a9652a first 7 years ago SY.json 11e3a9652a first 7 years ago SZ.json 11e3a9652a first 7 years ago TC.json 11e3a9652a first 7 years ago TD.json 11e3a9652a first 7 years ago TG.json 11e3a9652a first 7 years ago TH.json 11e3a9652a first 7 years ago TJ.json 11e3a9652a first 7 years ago TK.json 11e3a9652a first 7 years ago TL.json 11e3a9652a first 7 years ago TM.json 11e3a9652a first 7 years ago TN.json 11e3a9652a first 7 years ago TO.json 11e3a9652a first 7 years ago TR.json 11e3a9652a first 7 years ago TT.json 11e3a9652a first 7 years ago TV.json 11e3a9652a first 7 years ago TW.json 11e3a9652a first 7 years ago TZ.json 11e3a9652a first 7 years ago UA.json 11e3a9652a first 7 years ago UG.json 11e3a9652a first 7 years ago US.json 11e3a9652a first 7 years ago UY.json 11e3a9652a first 7 years ago UZ.json 11e3a9652a first 7 years ago VA.json 11e3a9652a first 7 years ago VC.json 11e3a9652a first 7 years ago VE.json 11e3a9652a first 7 years ago VG.json 11e3a9652a first 7 years ago VI.json 11e3a9652a first 7 years ago VN.json 11e3a9652a first 7 years ago VU.json 11e3a9652a first 7 years ago WF.json 11e3a9652a first 7 years ago WS.json 11e3a9652a first 7 years ago YE.json 11e3a9652a first 7 years ago YT.json 11e3a9652a first 7 years ago ZA.json 11e3a9652a first 7 years ago ZM.json 11e3a9652a first 7 years ago ZW.json 11e3a9652a first 7 years ago alt-af.json 11e3a9652a first 7 years ago alt-an.json 11e3a9652a first 7 years ago alt-as.json 11e3a9652a first 7 years ago alt-eu.json 11e3a9652a first 7 years ago alt-na.json 11e3a9652a first 7 years ago alt-oc.json 11e3a9652a first 7 years ago alt-sa.json 11e3a9652a first 7 years ago alt-ww.json 11e3a9652a first 7 years ago adminSystem - Gogs: Go Git Service

暂无描述

FFIB: 11e3a9652a first 7 年之前
..
configure 11e3a9652a first 7 年之前
lib 11e3a9652a first 7 年之前
.npmignore 11e3a9652a first 7 年之前
LICENSE 11e3a9652a first 7 年之前
README.md 11e3a9652a first 7 年之前
errors.js 11e3a9652a first 7 年之前
package.json 11e3a9652a first 7 年之前

README.md

<img src="https://promises-aplus.github.io/promises-spec/assets/logo-small.png" align="right" alt="Promises/A+ logo" />

request-promise-core

Gitter Build Status Coverage Status Dependency Status Known Vulnerabilities

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. Load the request library

// Only use a direct require if you are 100% sure that:
// - Your project does not use request directly. That is without the Promise capabilities by calling require('request').
// - Any of the installed libraries use request.
// ...because Request's prototype will be patched in step 2.
/* var request = require('request'); */

// Instead use:
var stealthyRequire = require('stealthy-require');
var request = stealthyRequire(require.cache, function () {
    return require('request');
});


// 2. Add Promise support to request

var configure = require('request-promise-core/configure/request2');

configure({
    request: request,
	// Pass your favorite ES6-compatible promise implementation
    PromiseImpl: Promise,
	// Expose all methods of the promise instance you want to call on the request(...) call
    expose: [
        'then',   // Allows to use request(...).then(...)
        'catch',  // Allows to use request(...).catch(...)
        'promise' // Allows to use request(...).promise() which returns the promise instance
    ],
    // Optional: Pass a callback that is called within the Promise constructor
    constructorMixin: function (resolve, reject) {
        // `this` is the request object
        // Additional arguments may be passed depending on the PromiseImpl used
    }
});


// 3. Use request with its promise capabilities

// E.g. crawl a web page:
request('http://www.google.com')
    .then(function (htmlString) {
        // Process html...
    })
    .catch(function (err) {
        // Crawling failed...
    });

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:

  1. clone the repo to your desktop,
  2. in the shell cd to the main folder,
  3. hit npm install,
  4. hit npm install gulp -g if you haven't installed gulp globally yet, and
  5. run gulp 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.

Change History

  • 1.1.1 (2016-08-08)
    • Renamed package to request-promise-core because there where too many issues with the scoped package name @request/promise-core
  • 1.1.0 (2016-07-30)
  • 1.0.0 (2016-07-15)
    • All tests green, ready for prime time
  • 1.0.0-rc.1 (2016-07-10)

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.