0.0.1 • Published 5 months ago

simple-website-screenshot-tool v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Simple Website Screenshotter

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 ScreenshotCapture = new ScreenshotCapture();
const singleResult = await ScreenshotCapture.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 },  
]));
0.0.1

5 months ago