Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ohpyupi/screenshotjs
- Owner: ohpyupi
- License: mit
- Created: 2022-06-04T06:05:04.000Z (over 2 years ago)
- Default Branch: develop
- Last Pushed: 2022-06-10T06:02:06.000Z (over 2 years ago)
- Last Synced: 2024-09-22T20:53:10.066Z (about 2 months ago)
- Topics: capture, screenshot
- Language: JavaScript
- Homepage:
- Size: 435 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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