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

output2pdf

v1.0.0

Published

Pack question PNG outputs into a print-ready PDF with minimal space.

Readme

javascript-report-pdf

Create a compact, print-ready A4 PDF from question screenshots named like 1.png, 2.png, 11.png.

The tool balances compact packing with readability so long outputs stay visible. Question labels are rendered above each image to avoid overlap with screenshot content.

Install

npm install -g output2pdf

After global install, run from anywhere:

make-pdf --help

For local development in this repository:

npm install
npm run make-pdf -- --help

Usage

make-pdf [roll_no] [input_dir] [output_pdf] [options]

Project structure

output2pdf/
├── make-report-pdf.js       # CLI entrypoint (thin wrapper)
├── src/
│   ├── cli.js               # Orchestration flow
│   ├── config.js            # Defaults and constants
│   ├── cli/
│   │   └── parse-args.js    # CLI argument parsing/help
│   ├── deps/
│   │   └── pdf-lib.js       # Dependency loading guard
│   ├── images/
│   │   ├── load-images.js   # PNG discovery + metadata load
│   │   └── png-meta.js      # PNG validation and dimensions
│   ├── layout/
│   │   └── index.js         # Page layout and orientation logic
│   ├── pdf/
│   │   └── generate-pdf.js  # PDF rendering
│   └── utils/
│       ├── args.js          # Generic arg helpers
│       └── questions.js     # Question filename parsing/sorting
├── package.json
└── README.md

Quick examples

# A4 PDF from current folder, output: javascript-report.pdf
make-pdf

# Add roll number beside every label
make-pdf 48

# Custom output file (".pdf" is auto-added if missing)
make-pdf 48 . final-report

# Extra-tight layout
make-pdf --roll 48 --compact

Options

  • -r, --roll, --roll-no <value>: Add roll number beside question labels.
  • -i, --input <dir>: Input folder containing .png files.
  • -o, --output <file>: Output PDF file.
  • -p, --paper <a4|letter>: Paper size (default: a4).
  • --orientation <auto|portrait|landscape>: Page orientation strategy.
  • -m, --margin <pt>: Page margin in points.
  • -g, --gap <pt>: Gap between images in points.
  • --compact: Tight preset (margin=8, gap=4, targetRowHeight=120).
  • --no-labels: Disable question labels.

Input format

  • Files must be PNG: *.png
  • Best ordering is numeric file names: 1.png, 2.png, ..., 10.png

License

MIT