Generate a image to base64, you can make this using a path or url.
It was think for supplement any situation, as for example save one string in database, too send the string to front-end increment one tag
First you should make one clone of the repository or install via NPM, later call it for where will to use.
npm i -S image-to-base64
const image2base64 = ;// you can also to use url
Is good remember that you can set one url of the image as parameter.
For to use on browser
You can make import with a tag
script for you to use. So see the example:
After you can to use conforme the example above of the Node.JS, but you must use URL.