HubSpot/node-webkit-screenshot

Name: node-webkit-screenshot

Owner: HubSpot

Description: Create screenshots using node-webkit

Created: 2015-10-20 14:41:11.0

Updated: 2017-07-12 13:54:00.0

Pushed: 2015-10-20 15:33:16.0

Homepage: null

Size: 103

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

node-webkit-screenshot NPM version Build Status

Create screenshots using node-webkit

Install
install node-webkit-screenshot
Usage
fs = require('fs');
screenshot = require('node-webkit-screenshot');

enshot({
l : 'http://google.de',
dth : 1024,
ight : 768

n(function(buffer){
.writeFile('./out.png', buffer, function(){
// This will close the screenshot service 
screenshot.close();
;

screenshot(options) port

Type: number Default: 3000

Specify custom port number for the webkit browser

delay

Type: number (seconds) Default: 0

Delay capturing the screenshot.

Useful when the site does things after load that you want to capture.

format

Type: string png|jpeg Default: png

Specify the image type fot he screenshot

width

Type: int Default: 0

Specify the with of the browser window

height

Type: int Default: 0

Specify the height of the browser window

crop (since 0.2.1)

Type: Object Default: undefined

This will only work if generating png's. A crop object may look like this:


p : 10,
ft : 10,
dth : 100,
ight : 100

close()

This will close the node-webkit process. You have to call this function before node is able to exit.

Troubleshooting

If you would like to use this on travis or with a framebuffer like xvfb than you need to set the environment variable NODESCREENSHOT_SHOW to 1. (export NODESCREENSHOT_SHOW). See this .travis.yml for more information

Changelog

0.3.1 0.3.0 0.2.1 0.2.0 0.1.0

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.