1.0.2 • Published 6 months ago

htmltobase64 v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

HtmlToBase64

Extremely simple tool to convert a HTML document to a base64 image

Usage

const htmlToBase64 = require("htmltobase64")
let width = 1280;
let height = 1080;

let replacements = {
        user: "dwiftejb"
} // replace anything that has {{key}} to value

let selector = "body"; // selects the element to screenshot and save as base64, leave empty to screenshot whole page.

async function main() {
    const base64 = await htmlToBase64("<h1>hello {{user}}</h1>", width, height, replacements, selector);
    console.log(base64);
}

main();
1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago