simple-website-screenshot-tool
v0.1.1
Published
A simple client-side screenshotter that doesn't require a server
Readme
Simple Website Screenshot Tool
A simple client-side website screenshotter that doesn't require a server.
Currently supported only in browsers based on Сhromium engine version >= 132, since it uses the RestrictionTarget interface from the Screen Capture API.
How it use
To generate a single screenshot:
import { ScreenshotCapture } from 'simple-website-screenshot-tool'
const capture = new ScreenshotCapture();
const singleResult = await capture.getScreenshot({ url: "https://example.com", width: 1920, height: 4000 });To generate multiple screenshots:
import { ScreenshotCapture } from 'simple-website-screenshot-tool'
const capture = new ScreenshotCapture();
const multipleResults = Array.fromAsync(capture.getScreenshots([
{ url: "https://example.com", width: 1920, height: 4000 },
{ url: "https://example.com", width: 1280, height: 1024 },
{ url: "https://example.com", width: 768, height: 1000 },
]));