Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

kimmobrunfeldt/url-to-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Kimmo Brunfeldt
Mar 8, 2014
9aa6942 · Mar 8, 2014

History

22 Commits
Mar 8, 2014
Mar 8, 2014
Mar 5, 2014
Mar 5, 2014
Mar 8, 2014
Mar 8, 2014
Mar 8, 2014
Mar 6, 2014
Mar 8, 2014
Mar 6, 2014

Repository files navigation

url-to-image

Build Status

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.

Usage

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
});

Install

npm install url-to-image

You need to have PhantomJS installed globally. phantomjs executable also needs to be in your PATH.

Test

npm test

You need to have mocha installed globally with npm install -g mocha.

Releasing

  • Edit [changelog][changelog.md]

  • grunt publish

    It will run tests and publish code to GitHub and npm

Attribution

This module was inspired by