1.15.0 • Published 9 months ago
screenshot-desktop v1.15.0
screenshot-desktop
Capture a screenshot of your local machine
- Multi/Cross Platform
- Linux: required ImageMagick
apt-get install imagemagick
- OSX: No dependencies required!
- Windows: No dependencies required!
- Linux: required ImageMagick
- Promise based API
- JPG output (by default)
Install
$ npm install --save screenshot-desktop
Usage
const screenshot = require('screenshot-desktop')
screenshot().then((img) => {
// img: Buffer filled with jpg goodness
// ...
}).catch((err) => {
// ...
})
const screenshot = require('screenshot-desktop')
screenshot({format: 'png'}).then((img) => {
// img: Buffer filled with png goodness
// ...
}).catch((err) => {
// ...
})
screenshot.listDisplays().then((displays) => {
// displays: [{ id, name }, { id, name }]
screenshot({ screen: displays[displays.length - 1].id })
.then((img) => {
// img: Buffer of screenshot of the last display
});
})
screenshot.all().then((imgs) => {
// imgs: an array of Buffers, one for each screen
})
screenshot({ filename: 'shot.jpg' }).then((imgPath) => {
// imgPath: absolute path to screenshot
// created in current working directory named shot.png
});
// absolute paths work too. so do pngs
screenshot({ filename: '/Users/brian/Desktop/demo.png' })
screenshot() options
filename
Optional. Absolute or relative path to save output.format
Optional. Valid valuespng|jpg
.linuxLibrary
Optional. Linux only. Valid valuesscrot|imagemagick
. Which library to use. Note that scrot does not support format or screen selection.
Licence
MIT © Ben Evans
1.15.0
9 months ago
1.14.1
9 months ago
1.14.0
10 months ago
0.0.0-development
1 year ago
1.12.7
3 years ago
1.12.6
3 years ago
1.12.5
3 years ago
1.12.4
3 years ago
1.12.3
3 years ago
1.12.2
4 years ago
1.12.1
4 years ago
1.12.0
4 years ago
1.11.0
4 years ago
1.10.0
4 years ago
1.9.0
5 years ago
1.8.0
5 years ago
1.7.0
5 years ago
1.6.1
5 years ago
1.6.0
5 years ago
1.5.5
5 years ago
1.5.4
5 years ago
1.5.3
5 years ago
1.5.2
6 years ago
1.5.1
6 years ago
1.5.0
6 years ago
1.4.3
6 years ago
1.4.2
6 years ago
1.4.1
6 years ago
1.4.0
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.0
6 years ago
1.1.0
8 years ago
1.0.0
8 years ago