协同程序(发生器)
const promiseReturningFunction = Promise.coroutine(function* (file) {
const data = yield fs.readFileAsync(file) // this returns a Promise and resolves to the file contents
return data.toString().toUpperCase()
})
promiseReturningFunction('file.txt').then(console.log)