create-image-in-browser

0.0.1 • Public • Published

create-image-in-browser

Build Status Coverage Npm Version MIT License

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

Data for the paint script

options

{
  type?: "image/png" | "image/jpeg" | "image/webp",
  quality: number,
}

Options for Canvas#toBlob()

Readme

Keywords

none

Package Sidebar

Install

npm i create-image-in-browser

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

6.06 kB

Total Files

4

Last publish

Collaborators

  • fisker