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

site2pdf-cli

v0.1.13

Published

Generate comprehensive PDFs of entire websites, ideal for RAG.

Downloads

274

Readme

site2pdf

Generate a single PDF containing all pages of a website. Ideal for AI-based Retrieval-Augmented Generation (RAG) and Question Answering (QA) tasks.

Features

  • Portability - Combine multiple pages into a single shareable PDF
  • AI Integration - Works with Google NotebookLM, ChatGPT GPTs, and other AI tools
  • Visual Preservation - Maintains images and formatting for multimodal models
  • Concurrent Processing - Processes multiple pages in parallel for faster generation

Quick Start

npx site2pdf-cli https://example.com

Output is saved to ./out/<domain>.pdf.

Installation (from source)

To install the tool globally on your machine from source, run:

git clone https://github.com/laiso/site2pdf.git
cd site2pdf
npm install
npm run build
npm link

After installation, you can run the tool directly using the site2pdf command from anywhere:

site2pdf <main_url> [url_pattern]

Prerequisites

Linux Dependencies

Puppeteer requires these system libraries:

sudo apt-get update
sudo apt-get install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
  libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
  libgbm1 libasound2

Note: On newer Ubuntu versions (24.04+), use libasound2t64 instead of libasound2.

Usage

npx site2pdf-cli <main_url> [url_pattern]

| Argument | Description | |----------|-------------| | <main_url> | The starting URL to crawl and convert | | [url_pattern] | Optional regex to filter which links to include (defaults to same domain) |

URL Pattern Formats

  • Plain string: 'https://example.com/docs' - matches URLs containing this string
  • Regex literal: '/https:\/\/example\.com\/docs/i' - full regex with flags

Examples

Basic usage (captures all same-domain links):

npx site2pdf-cli https://docs.example.com

Filter to specific section:

npx site2pdf-cli "https://www.typescriptlang.org/docs/handbook/" "https://www.typescriptlang.org/docs/handbook/2/"

Environment Variables

| Variable | Description | |----------|-------------| | CHROME_PATH | Path to a custom Chrome/Chromium executable |

Troubleshooting

Windows: Sandbox Errors

Grant permissions to the Puppeteer cache:

icacls %USERPROFILE%/.cache/puppeteer/chrome /grant *S-1-15-2-1:(OI)(CI)(RX)

See Puppeteer Windows troubleshooting.

ARM64 Linux: Not Supported

Chrome does not provide ARM64 binaries for Linux. You'll see errors like:

  • "Failed to launch the browser process!"
  • "chrome-linux64/chrome: 1: Syntax error: "(" unexpected"

See Chrome for Testing ARM64 Support Issue.

How It Works

  1. Launches headless Chrome via Puppeteer
  2. Navigates to the main URL and extracts all matching links
  3. Generates a PDF for each page concurrently
  4. Merges all PDFs into a single document using pdf-lib
  5. Saves to ./out/<slugified-url>.pdf

Development

git clone https://github.com/laiso/site2pdf.git
cd site2pdf
npm install

| Command | Description | |---------|-------------| | npm run dev -- <main_url> [url_pattern] | Run in development mode with watch | | npm run build | Compile TypeScript | | npm test | Run tests | | npx biome lint | Check for lint issues | | npx biome format | Format code |

Contributing

Issues and pull requests are welcome. Please follow the existing code style and include tests for new features.

License

MIT