node fetch image to base64

Solutions on MaxInterview for node fetch image to base64 by the best coders in the world

showing results for - "node fetch image to base64"
Diego Alejandro
19 Jun 2018
1import fetch from 'node-fetch'
2const res = await fetch(image)
3
4const imgBody = `data:${res.headers.get('content-type')};base64,${(await res.arrayBuffer()).toString('base64')}`