@petitchevalroux/url-to-base64-img

1.1.0 • Public • Published

url-to-base64-img

Convert images url to base64 datauri in html

In order to convert base64 to url images in html see base64-img-to-url

Install

npm install @petitchevalroux/url-to-base64-img

Usage

Example code

const Converter = require("@petitchevalroux/url-to-base64-img");
    converter = new Converter();
    converter.replace("<img src=\"https://example.com/img/1\">")
    .then(html=>{
        console.log(html);
    });

Output

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhAJ/wlseKgAAAABJRU5ErkJggg==">

Readme

Keywords

Package Sidebar

Install

npm i @petitchevalroux/url-to-base64-img

Weekly Downloads

0

Version

1.1.0

License

GPL-3.0

Unpacked Size

5 MB

Total Files

11

Last publish

Collaborators

  • petitchevalroux