async/await - 2.将async函数用在promise chain中
const fetch = require('node-fetch')
async function getZhihuColumn(id) {
const url = `https://zhuanlan.zhihu.com/api/columns/${id}`
const response = await fetch(url)
return await response.json()
}
getZhihuColumn('qianduanzhidian')
.then(creator => {
console.log(`name:${creator.name}`)
console.log(`description:${creator.description}`)
})