https://github.com/vutran/desktop-capture
Capture a screenshot of the desktop as a base64 encoded string. (OS X Only)
https://github.com/vutran/desktop-capture
capture desktop desktop-capture screen screenshot
Last synced: about 2 months ago
JSON representation
Capture a screenshot of the desktop as a base64 encoded string. (OS X Only)
- Host: GitHub
- URL: https://github.com/vutran/desktop-capture
- Owner: vutran
- Created: 2019-01-17T09:23:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-31T16:31:58.000Z (almost 5 years ago)
- Last Synced: 2025-04-07T17:17:27.116Z (about 2 months ago)
- Topics: capture, desktop, desktop-capture, screen, screenshot
- Language: Swift
- Homepage:
- Size: 28.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# desktop-capture
> Capture a screenshot of the desktop as a base64 encoded string.
_Note:_ This module only works for OS X.
## Install
```bash
$ npm i -S desktop-capture
```## Usage
```js
const capture = require("desktop-capture");// capture the main monitor
capture().then(b64 => {
console.log(b64);
});// capture a specific monitor (via screen ID)
capture({ id: 12345 }).then(b64 => {
console.log(b64);
});// override the path to the bin directory
capture({ overridePath: __dirname }).then(b64 => {
console.log(b64);
});
```## Build
With NPM:
```bash
$ npm run build
// -> ./desktop-capture
```With Swift:
```bash
$ swift build
// -> ./build/release/desktop-capture
```## Test
With NPM:
```bash
$ npm t
```With Swift:
```bash
$ swift test
```## License
MIT © [Vu Tran](https://github.com/vutran)