@xan105/screenshot
v2.0.0
Published
Take a screenshot of the active display in .png
Downloads
17
Maintainers
Readme
About
Take a screenshot of the active display in .png
Example
import { screenshot } from "@xan105/screenshot";
screenshot("./path/to/file.png").then(console.log).catch(console.error);
Install
npm install @xan105/screenshot
API
⚠️ This module is only available as an ECMAScript module (ESM) starting with version 2.0.0. Previous version(s) are CommonJS (CJS) with an ESM wrapper.
Named export
screenshot(filePath: string, overwrite?: boolean): Promise<string>
Take a screenshot in .png at given location. Doesn't overwrite if it already exists (default) unless you set overwrite to true. Returns png filepath.
NB: filepath extension will be enforced to '.png'