Socket
Socket
Sign inDemoInstall

canvas-screenshots

Package Overview
Dependencies
6
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    canvas-screenshots

canvas-screenshots is a useful screenshots tools on your website created by canvas.The behavior is similar with your PC clients like wechat or QQ.


Version published
Weekly downloads
24
increased by1100%
Maintainers
1
Install size
7.44 MB
Created
Weekly downloads
 

Readme

Source

canvas-screenshots

canvas-screenshots is a useful screenshots tools on your website created by canvas.The behavior is similar with your PC clients like wechat or QQ.

Installation

npm install --save-dev canvas-screenshots

Usage

import ScreenShoots from 'canvas-screenshots';

// generate a screenshots
const screen = new ScreenShoots({
    download: data => {
        console.log(data);
    },
});

// create mask above
screen.start();

Demo

demo

Surrpoted fcuntions

  • Rectangular
  • Circle & Ellipsis
  • Arrow
  • Pen
  • Text
  • Mosaic
  • Image
  • Back

Config

  • plugins

    The switch to each function.
    
    type: Array<pluginType>
    pluginType: 'rectangular' || 'circle' || 'arrow' || 'pen' || 'text' || 'mosaic' || 'image' || 'back'
    default: Array<all pluginType>
    required: false
    
  • download

    Trigger when click the download button, the type of output data will be decided by config type.
    
    type: Function
    default: noop function
    required: true
    arguments: data
    
  • imageFail

    Trigger when choose a image but not match the expected.
    
    type: Function
    default: noop function
    required: false
    arguments: error
    
  • outputType

    The output type with download.
    
    type: string('imageData' || 'png' || 'file')
    default: 'imageData'
    required: false
    

Surrported browsers

  • Chrome

The browsers supported is now minimal because of the different behavior of canvas, and it will soon be more.

FAQs

Last updated on 25 Jan 2022

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