Shell
request的promise化
var Promise = require('bluebird')
var request = Promise.promisify(request)
var wechat = new
stringify。
promisifyAll
--
const Promise = require('bluebird'),
fs = require('fs'),
path = require('path');
Promise.promisifyAll(fs);
fs.readFileAsync(path.join(__dirname, 'sample.txt'), 'utf-8')
.then(data => console.log(data))
.catch(err => console.error(err));
--
相关推荐
lei0 2020-11-02
webgm 2020-08-16
igogo00 2020-07-04
iconhot 2020-06-26
疯狂紫萧 2020-06-16
yezitoo 2020-06-06
SelinaChan 2020-05-15
luckymaoyy 2020-04-25
80437700 2020-04-17
austindev 2020-04-07
我有一只小松鼠 2020-02-29
webfullStack 2020-02-15
binglingnew 2012-10-03
始作俑者 2020-01-19
jinxiutong 2020-01-04
Dawnworld 2019-12-23
yezitoo 2019-12-05
moyigg 2019-12-02