📜  节点获取图像到 base64 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:29.595000             🧑  作者: Mango

代码示例1
import fetch from 'node-fetch'
const res = await fetch(image)

const imgBody = `data:${res.headers.get('content-type')};base64,${(await res.arrayBuffer()).toString('base64')}`