
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
node-screenshot-machine
Advanced tools
Simple node.js wrapper for Screenshot Machine's API.
Screenshot Machine provides a very simple url-based API, with config options passed as optional url params. This library provides a convenient, node-ish wrapper that makes using Screenshot Machine in your node app a snap.
Run npm install node-screenshot-machine
or git clone then npm install
Optionally run unit tests: npm test
Initializing the node-screenshot-machine module is simple:
var screenshot = require('node-screenshot-machine')({
key: ***** // your screenshotmachine API key
});
Capturing a website screenshot is also simple:
screenshot.get(options, callback);
The module handles standard callback-style invocation:
screenshot.get({
url: 'www.test.com'
},
function(err, result){
if (err) {
// handle error
}
// handle result
});
as well as promise-style:
screenshot.get({
url: 'www.test.com'
})
.then(function(result){
// handle result
})
.catch(function(err){
// handle error
});
For ease of use, you can also simply pass in a url string, which will capture a screenshot using the default settings (or any settings passed in during setup):
screenshot.get('www.test.com')
.then(function(result){
// handle result
})
.catch(function(err){
// handle error
});
These are all the options supported by the .get method (complete details can be found in Screenshot Machine's API guide):
Required
Optional
Note that the screenshot.get method optionally supports streaming the captured image directly to any writable stream using the optional writeStream option:
var imageFileStream = require('fs').createWriteStream('siteImage.png');
screenshot.get({
url: 'www.someurl.com',
format: 'PNG',
writeStream: imageFileStream
});
MIT
Copyright © 2015 Level Seven
FAQs
Simple node.js wrapper for Screenshot Machine's API
We found that node-screenshot-machine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.