Takes screeshot of a given page. This module correctly handles pages which dynamically load content making AJAX requests. Instead of waiting fixed amount of time before rendering, we give a short time for the page to make additional requests.
var screenshot = require('url-to-image');
screenshot('http://google.com', 'google.png').fail(function(err) {
console.error(err);
}).done(function() {
// now google.png exists and contains screenshot of google.com
});
npm install url-to-image
You need to have PhantomJS installed globally. phantomjs
executable also needs to be in your PATH.
npm test
You need to have mocha installed globally with npm install -g mocha
.
-
Edit [changelog][changelog.md]
-
grunt publish
It will run tests and publish code to GitHub and npm
This module was inspired by