Socket
Socket
Sign inDemoInstall

create-image-in-browser

Package Overview
Dependencies
64
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    create-image-in-browser

Create image with the `<canvas>` element


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Install size
8.63 MB
Created
Weekly downloads
 

Readme

Source

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()

FAQs

Last updated on 10 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc