Take screenshots using node-webkit
npm install node-webkit-screenshotnode-webkit-screenshot  
---
> Create screenshots using node-webkit
``shell`
npm install node-webkit-screenshot
`js
var fs = require('fs');
var screenshot = require('node-webkit-screenshot');
screenshot({
url : 'http://google.de',
width : 1024,
height : 768
})
.then(function(buffer){
fs.writeFile('./out.png', buffer, function(){
// This will close the screenshot service
screenshot.close();
});
});
`
#### screenshot(options)
##### port
Type: number3000
Default:
Specify custom port number for the webkit browser
##### delay
Type: number (seconds)0
Default:
Delay capturing the screenshot.
Useful when the site does things after load that you want to capture.
##### format
Type: string png|jpegpng
Default:
Specify the image type fot he screenshot
##### width
Type: int0
Default:
Specify the with of the browser window
##### height
Type: int0
Default:
Specify the height of the browser window
##### crop (since 0.2.1)Object
Type: undefined
Default:
This will only work if generating png's.
A crop object may look like this:
`js`
{
top : 10,
left : 10,
width : 100,
height : 100
}
#### close()
This will close the node-webkit process. You have to call this function before node is able to exit.
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)..travis.yml
See this for more information
##### 0.3.2
* Fix installation of sub modules for nw-screenshot
* Upgrade various modules
##### 0.3.1
* Fix black backgrounds in screenshots.
##### 0.3.0close()
* Add method.
##### 0.2.1toolbar
* remove for node-webkitcrop
* Add option.
##### 0.2.0
* Rewrite using socket.io to communicate between a single nw-snapshot instance.
* Promise based API
##### 0.1.0`
* 0.1.0 Inital release