New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

desktop-screenshot

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

desktop-screenshot

Cross-platform screenshot module, using external tools

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
decreased by-16.5%
Maintainers
1
Weekly downloads
 
Created
Source

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) and OSX (darwin) platforms

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

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
  • Linux support
  • Multi-screen support
  • Cropping
  • Return contents of image, rather than writing file

FAQs

Package last updated on 19 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc