@xan105/screenshot
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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'

Package Sidebar

Install

npm i @xan105/screenshot

Weekly Downloads

4

Version

2.0.0

License

MIT

Unpacked Size

5.93 MB

Total Files

6

Last publish

Collaborators

  • xan105