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 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-api-pdf

v0.3.2

Published

Simple utility to create PDF version of Node.js API docs

Readme

node-api-pdf

Simple utility to create PDF version of Node.js API docs.

Installation

$ npm install -g node-api-pdf

One thing: for gnu/linux without a graphical environment install xvfb before

$ sudo apt-get install xvfb # or equivalent

Command Line Usage

Usage: index [options] [versions...]

  Versions:

    This is Node.js version. By default it is "current". Also can be "latest", strict version like "7.10.0" or major
    version like "7" (it means latest 7.x). And of course you can list versions with space like "current 4 latest"

  Options:

    -o, --output                     Output directory (if no configured CWD will be used)
    -x, --use-xvfb                   Use it if run on system without a graphical environment.
                                     Please install "xvfb" before (like "sudo apt-get install xvfb" or equivalent)
    -c, --config <customConfigFile>  Custom config file (js/json) where listed Node.js versions and render options.
                                     Example available in documentation or check "config.js" file placed in module distr
    -h, --help                       output usage information

Examples

Create pdf for installed Node.js version

$ node-api-pdf

..or the same thing but using argument current

$ node-api-pdf current

Now lets create pdf for Node.js versions 9.3.0

$ node-api-pdf 9.3.0

Create pdf for latest 8.x and save to ~/node-docs/

$ node-api-pdf 8 --output ~/node-docs/

If we want pdf for latest Node.js versions and our system has not graphical environment (dont forget install xvfb before)

$ node-api-pdf latest --use-xvfb

One more with multiple versions (latest 6.x and 8.9.3) and custom config file (js or json allowed)

$ node-api-pdf 6 8.9.3 -x --config ~/custom-config.json

What about config file? So, default config (with comments) is placed in PACKAGE_ROOT/config.js (check it on GitHub). It has 2 sections: docs and pdfGenerator. docs has map of versions to create pdf. pdfGenerator has settings for renderer: out directory, xvfb usage and options for electron-pdf.

Simplified version of config:

module.exports = {
    docs: {
        7: {
            enabled: false
        },
        8: {
            enabled: true
        },
        latest: {
            enabled: false
        },
        current: {
            enabled: true
        }
    },

    pdfGenerator: {
        /**
         * Directory for created PDF
         */
        out: '~/devdocs/',

        /**
         * Use xvfb-run to execute electron without x-server
         */
        xvfb: true,

        /**
         * https://www.npmjs.com/package/electron-pdf#all-available-options
         */
        electronPdf: {
            // Can be A3, A4, A5, Legal, Letter, Tabloid or an Object containing height and width in microns
            pageSize: 'A5',
        }
    }
};

License

MIT