node-cgo-screenshot

module
v0.0.0-...-31832fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2023 License: MIT

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'

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL