npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

phantomjs-render-large-page

v0.4.0

Published

PhantomJS can’t render very tall or wide pages (more than 30k pixels). This library is a workaround to do it anyway.

Readme

phantomjs-render-large-page

PhantomJS can't render very tall or wide pages (more than 30k pixels). This library is a workaround to do it anyway.

Installation

You need imagemagick installed. In ubuntu, you can install it like this:

sudo apt-get update
sudo apt-get install imagemagick

You may need to change its policy at /etc/ImageMagick-6/policy.xml. These are the values that worked for the tests:

Windows is not supported.

Then

npm install phantomjs-render-large-page --save

Usage

Include it like this:

var renderLargePage = require('phantomjs-render-large-page').renderLargePage;

in you PhantomJS script.

renderLargePage is a phantomjs script that expects to be included from inside a phantomjs script, not called directly.

For example:

//screenshot.js
var renderLargePage = require('phantomjs-render-large-page').renderLargePage;
var page = require('webpage').create();

page.open('http://example.com', function () {
    renderLargePage(page, 'screenshot.png', function (error) {
        phantom.exit();
    });
});

Parameters

The renderLargePage function accepts the following parameters:

renderLargePage(page, filename, callback, [options]);

page is the PhantomJS page object to render.

filename is a file path where the output image will be rendered, as you would pass it to PhantomJS' render function

callback is a function that will be called on complete. callback will be passed an error parameter, that will only be present if there was an error.

options is an optional object with the following optional properties:

options.tmpDir a path to the directory where renderLargePage will write intermediate files. Defaults to process.env.TMPDIR (usually /tmp)

options.format it will be passed as the second parameter to PhantomJS' render function. Defaults to 'png'

options.quality it will be passed as the third parameter to PhantomJS' render function and to ImageMagick's -quality option. Defaults to 100.

options.limit Side of the square partial images rendered and stitched together later. Potentially useful to limit memory use. Defaults to 30720

For more information on supported image formats, quality, etc, see the PhantomJS docs for the render functionality:

http://phantomjs.org/api/webpage/method/render.html