Collect base64 images for fixture usage
Visit here to download images or copy base64 string
Alternatively, install base64-image-fixture
package.
$ yarn add dev base64-image-fixture
And, read as utf-8 string.
import fs from 'fs'
const base64PNGString =
fs.readFileSync(
'./node_modules/base64-image-fixture/png/1x1-transparent',
'utf8'
)
console.log(base64PNGString)
// => data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=
MIT