Import Debian changes 1.1.2-1
node-request-promise-core (1.1.2-1) unstable; urgency=low
* Initial release (Closes: #929233)
Ying-Chun Liu (PaulLiu)
4 years ago
0 | node-request-promise-core (1.1.2-1) unstable; urgency=low | |
1 | ||
2 | * Initial release (Closes: #929233) | |
3 | ||
4 | -- Ying-Chun Liu (PaulLiu) <paulliu@debian.org> Sun, 19 May 2019 17:23:21 +0800 |
0 | 10 |
0 | Source: node-request-promise-core | |
1 | Section: javascript | |
2 | Priority: optional | |
3 | Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org> | |
4 | Uploaders: Ying-Chun Liu (PaulLiu) <paulliu@debian.org> | |
5 | Build-Depends: chai, | |
6 | debhelper (>= 10), | |
7 | gulp, | |
8 | node-bluebird, | |
9 | node-body-parser, | |
10 | node-chalk, | |
11 | node-request, | |
12 | node-rimraf, | |
13 | node-run-sequence, | |
14 | node-stealthy-require, | |
15 | nodejs (>= 6) | |
16 | Standards-Version: 4.3.0 | |
17 | Homepage: https://github.com/request/promise-core#readme | |
18 | Vcs-Git: https://salsa.debian.org/js-team/node-request-promise-core.git | |
19 | Vcs-Browser: https://salsa.debian.org/js-team/node-request-promise-core | |
20 | ||
21 | Package: node-request-promise-core | |
22 | Architecture: all | |
23 | Depends: node-lodash (>= 4.17.11), nodejs (>= 6), ${misc:Depends} | |
24 | Description: core logic for adding Promise support to request for Node.js | |
25 | This package is the core library of node-request-promise. Normal users should | |
26 | just use node-request-promise. It is only recommended to use this library | |
27 | directly, if you have very specific requirements. | |
28 | . | |
29 | Node.js is an event-based server-side JavaScript engine. |
0 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | |
1 | Upstream-Name: request-promise-core | |
2 | Upstream-Contact: https://github.com/request/promise-core/issues | |
3 | Source: https://github.com/request/promise-core#readme | |
4 | ||
5 | Files: * | |
6 | Copyright: 2016-2019 Nicolai Kamenzky (https://github.com/analog-nico) | |
7 | License: ISC | |
8 | ||
9 | Files: debian/* | |
10 | Copyright: 2019 Ying-Chun Liu (PaulLiu) <paulliu@debian.org> | |
11 | License: ISC | |
12 | ||
13 | License: ISC | |
14 | Permission to use, copy, modify, and/or distribute this software for any | |
15 | purpose with or without fee is hereby granted, provided that the above | |
16 | copyright notice and this permission notice appear in all copies. | |
17 | . | |
18 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
19 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
20 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
21 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
22 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
23 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
24 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
0 | README.md |
0 | configure usr/lib/nodejs/request-promise-core/ | |
1 | errors.js usr/lib/nodejs/request-promise-core/ | |
2 | lib usr/lib/nodejs/request-promise-core/ | |
3 | package.json usr/lib/nodejs/request-promise-core/ |
0 | #!/usr/bin/make -f | |
1 | # -*- makefile -*- | |
2 | ||
3 | # Uncomment this to turn on verbose mode. | |
4 | #export DH_VERBOSE=1 | |
5 | ||
6 | %: | |
7 | dh $@ | |
8 | ||
9 | # Do not run dh_auto_configure because configure is a directory. | |
10 | override_dh_auto_configure: | |
11 |
0 | 3.0 (quilt) |
0 | Tests: require | |
1 | Depends: node-request-promise-core | |
2 | ||
3 | Tests: test-example01 | |
4 | Depends: node-promise, node-request, node-stealthy-require, @ |
0 | // 1. Load the request library | |
1 | ||
2 | // Only use a direct require if you are 100% sure that: | |
3 | // - Your project does not use request directly. That is without the Promise capabilities by calling require('request'). | |
4 | // - Any of the installed libraries use request. | |
5 | // ...because Request's prototype will be patched in step 2. | |
6 | /* var request = require('request'); */ | |
7 | ||
8 | // Instead use: | |
9 | var stealthyRequire = require('stealthy-require'); | |
10 | var request = stealthyRequire(require.cache, function () { | |
11 | return require('request'); | |
12 | }); | |
13 | ||
14 | ||
15 | // 2. Add Promise support to request | |
16 | ||
17 | var configure = require('request-promise-core/configure/request2'); | |
18 | ||
19 | configure({ | |
20 | request: request, | |
21 | // Pass your favorite ES6-compatible promise implementation | |
22 | PromiseImpl: Promise, | |
23 | // Expose all methods of the promise instance you want to call on the request(...) call | |
24 | expose: [ | |
25 | 'then', // Allows to use request(...).then(...) | |
26 | 'catch', // Allows to use request(...).catch(...) | |
27 | 'promise' // Allows to use request(...).promise() which returns the promise instance | |
28 | ], | |
29 | // Optional: Pass a callback that is called within the Promise constructor | |
30 | constructorMixin: function (resolve, reject) { | |
31 | // `this` is the request object | |
32 | // Additional arguments may be passed depending on the PromiseImpl used | |
33 | } | |
34 | }); | |
35 | ||
36 | ||
37 | // 3. Use request with its promise capabilities | |
38 | ||
39 | // E.g. crawl a web page: | |
40 | request('http://localhost') | |
41 | .then(function (htmlString) { | |
42 | // Process html... | |
43 | console.log("then called - process html..."); | |
44 | }) | |
45 | .catch(function (err) { | |
46 | // Crawling failed... | |
47 | console.log("catch called - crawling failed..."); | |
48 | }); |