如果能重新起名,Promsie plus感觉会更合适一些。
- 超时的处理
cosnt Promise = require("bluebird");
const fs = Promise.promisifyAll(require('fs'));
fs.readFileAsync("win11.ios")
.timeout(1000, "文件读取超时")
.then(function(fileContents) {
//success
}).catch(e=>{
console.error(e)
})
;