Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linusu/node-capture-window
Capture a desktop window to a png file. Simple and easy.
https://github.com/linusu/node-capture-window
Last synced: 4 days ago
JSON representation
Capture a desktop window to a png file. Simple and easy.
- Host: GitHub
- URL: https://github.com/linusu/node-capture-window
- Owner: LinusU
- License: mit
- Created: 2015-01-19T10:35:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-11-07T10:34:53.000Z (about 2 years ago)
- Last Synced: 2024-11-02T10:22:49.380Z (11 days ago)
- Language: Objective-C
- Size: 15.6 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# `capture-window`
Capture a desktop window to a png file. Simple and easy.
## Installation
```sh
npm install --save capture-window
```## Usage
```javascript
const captureWindow = require('capture-window')captureWindow('Finder', 'Downloads').then((filePath) => {
// filePath is the path to a png file
})
```## API
### `captureWindow(bundle, title[, filePath])`
- `bundle` (`string`, required)
- `title` (`string`, required)
- `filePath` (`string | null`, optional)
- returns `Promise` - path to a png fileCaptures the window with the title `title` of type `bundle`. `bundle` is usually the name of the application, e.g. `Finder`, `Safari`, `Terminal`.
## OS Support
Only `Mac OS X` at the time being. The source is well prepared for other systems, pull requests welcome.
## License
MIT