1.0.3 • Published 10 months ago
w-html2png v1.0.3
w-html2png
A package for html to png by chromium.
Documentation
To view documentation or get support, visit docs.
Installation
Using npm(ES6 module):
Note: w-html2png is mainly dependent on
puppeteer
.npm i w-html2png
Example for function:
Link: [dev source code]
import WHtml2png from './src/WHtml2png.mjs'
async function testa() {
let html = `
let b64 = await WHtml2png(width, height, scale, html)
// console.log('b64', b64)
fs.writeFileSync('./test-scla.png', b64, { encoding: 'base64' })
console.log('finish')
} testa() .catch((err) => { console.log(err) })