@wfkit/elshot
v1.0.2
Published
html element to image
Downloads
10
Readme
@wfkit/elshot
Installation
pnpm i @wfkit/elshot
Usage
import { createElShot } from '@wfkit/elshot'
// defautl
const shot = createElShot({
name: 'html-to-image',
})
// or html2canvas
const shot = createElShot({
name: 'html2canvas',
})
// or modern-screenshot
const shot = createElShot({
name: 'modern-screenshot',
})
// or custom
const shot = createElShot({
name: '<provider name>',
url: `<provider script url>`,
toCanvas: (_el, _options) => {
// ...
},
})
// shot
await shot.toCanvas(el, options)
License
MIT © YDWF.COM