0.0.1 • Published 2 years ago
create-image-in-browser v0.0.1
create-image-in-browser
Create image with the
<canvas>
element
Installation
yarn add create-image-in-browser
Usage
import createImage from 'create-image-in-browser'
const buffer = await createImage('path/to/paint-script.js')
console.log(result)
//=> <Buffer 89 50 4e 47 0d ...>
API
createImage(script, data?, options?)
script
- type:
string|URL
Path to the paint script
data
- type:
Serializable
Data for the paint script
options
{
type?: "image/png" | "image/jpeg" | "image/webp",
quality: number,
}
Options for Canvas#toBlob()