【文件属性】:
文件名称:httpx:带电源的http(s)模块
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-28 21:46:22
JavaScript
httpx
带电源的http(s)模块。
安装
$ npm install httpx --save
用法
'use strict' ;
const httpx = require ( 'httpx' ) ;
httpx . request ( 'http://www.baidu.com/' ) . then ( ( response ) => {
response . pipe ( process . stdout ) ;
response . on ( 'end' , ( ) => {
process . stdout . write ( '\n' ) ;
} ) ;
} , ( err ) => {
// on error
} ) ;
或与co 。
co ( function * ( ) {
var response = yield httpx
【文件预览】:
httpx-master
----.travis.yml(73B)
----package.json(954B)
----.eslintrc.json(1KB)
----test()
--------index.test.js(4KB)
----.gitignore(35B)
----lib()
--------index.js(7KB)
--------index.d.ts(696B)
----README.md(3KB)
----.eslintignore(35B)