convert-base64-to-image
v0.0.16
Published
This is a node package that helps you to convert base64 string created by javascript file reader to image downloadable file
Downloads
1,704
Maintainers
Readme
Convert Base64 to Image
Demo
Check out the demo which uses an Express server Demo
Installation
Using npm:
$ npm i convert-base64-to-image
Using yarn:
$ yarn add convert-base64-to-image
General usage:
import { converBase64ToImage } from 'convert-base64-to-image'
const base64 = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD//'
const pathToSaveImage = './public/image.png'
const path = converBase64ToImage(base64, pathToSaveImage) //returns path /public/image.png
Why use this package?
It allows you to upload files using the base64 string created by FileReader into your server.