package.json
5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
"_args": [
[
{
"raw": "httpx@^2.1.2",
"scope": null,
"escapedName": "httpx",
"name": "httpx",
"rawSpec": "^2.1.2",
"spec": ">=2.1.2 <3.0.0",
"type": "range"
},
"/Users/fzy/project/koa2_Sequelize_project/node_modules/@alicloud/pop-core"
]
],
"_from": "httpx@>=2.1.2 <3.0.0",
"_id": "httpx@2.1.2",
"_inCache": true,
"_location": "/httpx",
"_nodeVersion": "7.7.4",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/httpx-2.1.2.tgz_1495703755237_0.4486262151040137"
},
"_npmUser": {
"name": "jacksontian",
"email": "shyvo1987@gmail.com"
},
"_npmVersion": "4.1.2",
"_phantomChildren": {},
"_requested": {
"raw": "httpx@^2.1.2",
"scope": null,
"escapedName": "httpx",
"name": "httpx",
"rawSpec": "^2.1.2",
"spec": ">=2.1.2 <3.0.0",
"type": "range"
},
"_requiredBy": [
"/@alicloud/mns",
"/@alicloud/pop-core"
],
"_resolved": "https://registry.npmjs.org/httpx/-/httpx-2.1.2.tgz",
"_shasum": "59aec158ad68df0aad368a729b25f22a8dbfb114",
"_shrinkwrap": null,
"_spec": "httpx@^2.1.2",
"_where": "/Users/fzy/project/koa2_Sequelize_project/node_modules/@alicloud/pop-core",
"author": {
"name": "Jackson Tian"
},
"bugs": {
"url": "https://github.com/JacksonTian/httpx/issues"
},
"dependencies": {
"debug": "^2.2.0"
},
"description": "http(s) module with power",
"devDependencies": {
"co-mocha": "^1.1.3",
"coveralls": "^2.11.15",
"eslint": "^3.13.1",
"istanbul": "^0.4.5",
"mocha": "^3.2.0"
},
"directories": {},
"dist": {
"shasum": "59aec158ad68df0aad368a729b25f22a8dbfb114",
"tarball": "https://registry.npmjs.org/httpx/-/httpx-2.1.2.tgz"
},
"files": [
"lib"
],
"gitHead": "bbe3ce084ae2818be6051d0018ab2618e5f2f24a",
"homepage": "https://github.com/JacksonTian/httpx",
"license": "MIT",
"main": "lib/index.js",
"maintainers": [
{
"name": "jacksontian",
"email": "shyvo1987@gmail.com"
}
],
"name": "httpx",
"optionalDependencies": {},
"readme": "httpx\n===========\nhttp(s) module with power.\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[](https://coveralls.io/github/JacksonTian/httpx?branch=master)\n[![David deps][david-image]][david-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/httpx.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/httpx\n[travis-image]: https://img.shields.io/travis/JacksonTian/httpx.svg?style=flat-square\n[travis-url]: https://travis-ci.org/JacksonTian/httpx\n[david-image]: https://img.shields.io/david/JacksonTian/httpx.svg?style=flat-square\n[david-url]: https://david-dm.org/JacksonTian/httpx\n[download-image]: https://img.shields.io/npm/dm/httpx.svg?style=flat-square\n[download-url]: https://npmjs.org/package/httpx\n\n## Installation\n\n```bash\n$ npm install httpx --save\n```\n\n## Usage\n\n```js\n'use strict';\n\nconst httpx = require('httpx');\n\nhttpx.request('http://www.baidu.com/').then((response) => {\n response.pipe(process.stdout);\n\n response.on('end', () => {\n process.stdout.write('\\n');\n });\n}, (err) => {\n // on error\n});\n```\n\nOr with `co`.\n\n```js\nco(function* () {\n var response = yield httpx.request('http://www.baidu.com/');\n\n response.pipe(process.stdout);\n\n response.on('end', () => {\n process.stdout.write('\\n');\n });\n});\n```\n\nOr with `async/await`.\n\n```js\n(async function () {\n var response = await httpx.request('http://www.baidu.com/');\n\n response.pipe(process.stdout);\n\n response.on('end', () => {\n process.stdout.write('\\n');\n });\n})();\n```\n\n## API\n\n### `httpx.request(url[, options])`\n\n- **url** String | Object - The URL to request, either a String or a Object that return by [url.parse](http://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost).\n- ***options*** Object - Optional\n - ***method*** String - Request method, defaults to `GET`. Could be `GET`, `POST`, `DELETE` or `PUT`.\n - ***data*** String | [Buffer](http://nodejs.org/api/buffer.html) | Readable - Manually set the content of payload.\n - ***headers*** Object - Request headers.\n - ***timeout*** Number - Request timeout in milliseconds. Defaults to 3000. When timeout happen, will return `RequestTimeout`.\n - ***agent*** [http.Agent](http://nodejs.org/api/http.html#http_class_http_agent) - HTTP/HTTPS Agent object.\n Set `false` if you does not use agent.\n - ***beforeRequest*** Function - Before request hook, you can change every thing here.\n - ***compression*** Boolean - Enable compression support. Tell server side responses compressed data\n\n### `httpx.read(response[, encoding])`\n\n- **response** Response - the Client response. Don't setEncoding() for the response.\n- **encoding** String - Optional.\n\n## License\nThe MIT license\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/JacksonTian/httpx.git"
},
"scripts": {
"test": "make test"
},
"version": "2.1.2"
}