Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ohpyupi/screenshotjs

The module helps to take a screenshot in browsers.
https://github.com/ohpyupi/screenshotjs

capture screenshot

Last synced: about 1 month ago
JSON representation

The module helps to take a screenshot in browsers.

Awesome Lists containing this project

README

        

# ScreenshotJS
The module helps to take a screenshot in browsers.

## Demo
![Screenshot Demo Gif](./demo.gif)

## Installation
```bash
npm install html2canvas @ohpyupi/screenshotjs -S
```

## Methods
### capture(options) -> void
Allows users to select an area to be screenshotted.

#### Parameters
| Name | Type | Description |
|--------------------|-------------------|------------------------------------------------------------|
| options.onComplete | (dataUrl) => void | A callback called when the area of screenshot is selected. |

### download(dataUrl, filename) -> void
Downloads an image dataUrl to the local drive.

#### Parameters
| Name | Type | Description |
|----------|--------|-----------------------------------|
| dataUrl | string | Image data in data url format |
| filename | string | The filename of image data |

## License
MIT