Skip to content

Capture a desktop window to a png file. Simple and easy.

License

Notifications You must be signed in to change notification settings

appdmg/capture-window

 
 

Repository files navigation

capture-window

Capture a desktop window to a png file. Simple and easy.

Installation

npm install --save capture-window

Usage

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<string> - path to a png file

Captures 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

About

Capture a desktop window to a png file. Simple and easy.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 75.4%
  • JavaScript 13.3%
  • C 7.2%
  • Python 4.1%