# desktop-screenshot

> Cross-platform screenshot module, using external tools

Latest version **0.1.1** (published 2016-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install desktop-screenshot
pnpm add desktop-screenshot
yarn add desktop-screenshot
bun add desktop-screenshot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-08-28 |
| First published | 2015-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 96 |
| Author | John Murphy-Teixidor |
| Maintainers | johnvmt |

## Links

- npm: https://www.npmjs.com/package/desktop-screenshot
- Repository: https://github.com/johnvmt/node-desktop-screenshot
- Homepage: https://github.com/johnvmt/node-desktop-screenshot#readme
- Issues: https://github.com/johnvmt/node-desktop-screenshot/issues
- npm.io page: https://npm.io/package/desktop-screenshot

## Dependencies (2)

- [jimp](https://npm.io/package/jimp.md) 0.2.x
- [flavored-path](https://npm.io/package/flavored-path.md) 0.0.x

## Recent versions

- 0.1.1 (latest) — 2016-08-28
- 0.1.0 — 2016-06-10
- 0.0.6 — 2015-05-20
- 0.0.5 — 2015-05-19
- 0.0.4 — 2015-05-19
- 0.0.3 — 2015-05-19
- 0.0.2 — 2015-05-19
- 0.0.1 — 2015-05-19

## README

# node-desktop-screenshot #
Take a screenshot of the computer on which Node is running, using platform-specific external tools included with the package

Supports Windows (win32), OSX (darwin) and Linux platforms

Windows version uses nircmd (http://nircmd.nirsoft.net)
Linux version uses scrot

## Available Options ##

- quality: JPEG quality (0 to 100)
- width: use in conjunction with height, or by itself to maintain aspect ratio
- height: use in conjunction with width, or by itself to maintain aspect ratio

## Examples ##

### Full resolution ###
	var screenshot = require('desktop-screenshot');
	
    screenshot("screenshot.png", function(error, complete) {
        if(error)
            console.log("Screenshot failed", error);
        else
            console.log("Screenshot succeeded");
    });
    
### Resize to 400px wide, maintain aspect ratio ###

    var screenshot = require('desktop-screenshot');

    screenshot("screenshot.png", {width: 400}, function(error, complete) {
        if(error)
            console.log("Screenshot failed", error);
        else
            console.log("Screenshot succeeded");
    });
    
### Resize to 400x300, set JPG quality to 60% ###

    var screenshot = require('desktop-screenshot');

    screenshot("screenshot.jpg", {width: 400, height: 300, quality: 60}, function(error, complete) {
        if(error)
            console.log("Screenshot failed", error);
        else
            console.log("Screenshot succeeded");
    });
    
## TODOs ##

- Tests
- Multi-screen support
- Cropping
- Return contents of image, rather than writing file

---
_Source: https://npm.io/package/desktop-screenshot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
