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

rusty-pdf

v1.1.2

Published

A React PDF reader powered by Rust/WASM with theming support

Readme

🦀 Rusty PDF

A lightweight React PDF viewer powered by Rust/WASM with theming support.

npm version License: MIT

Features

  • 📄 Rust-Powered PDF Rendering - Fast PDF display via WebAssembly
  • 🎨 Theme Support - Light, dark, or system preference modes
  • 📱 Simple Navigation - Built-in page controls and download button
  • Lightweight - Only 66KB unpacked

Installation

npm install rusty-pdf

Usage

import RustyPdf from 'rusty-pdf';
import 'rusty-pdf/styles.css';

function App() {
  return (
    <RustyPdf 
      url="https://example.com/document.pdf"
      theme="system"
    />
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | url | string | required | URL of the PDF file to display | | theme | 'light' \| 'dark' \| 'system' | 'system' | Theme mode for the viewer |


Themes

The viewer supports three theme modes:

| Theme | Description | |-------|-------------| | light | Light background with dark text | | dark | Dark background with light text | | system | Automatically matches OS preference |

// Force light mode
<RustyPdf url="/doc.pdf" theme="light" />

// Force dark mode  
<RustyPdf url="/doc.pdf" theme="dark" />

// Follow system preference (default)
<RustyPdf url="/doc.pdf" theme="system" />

Built-in Controls

The viewer includes a toolbar with:

| Control | Description | |---------|-------------| | | Previous page | | Page indicator | Shows current page / total pages | | | Next page | | | Download PDF |


Styling

Import the included stylesheet:

import 'rusty-pdf/styles.css';

Or customize by targeting these CSS classes:

.pdf-wrapper { }      /* Main container */
.pdf-toolbar { }      /* Navigation bar */
.pdf-loading { }      /* Loading spinner container */
.pdf-spinner { }      /* Loading animation */
.canvas-container { } /* PDF canvas wrapper */
.pdf-footer { }       /* Footer with credits */
.pdf-light { }        /* Light theme */
.pdf-dark { }         /* Dark theme */

Complete Example

import React from 'react';
import RustyPdf from 'rusty-pdf';
import 'rusty-pdf/styles.css';

function PDFViewer() {
  return (
    <div style={{ height: '100vh' }}>
      <RustyPdf 
        url="https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf"
        theme="dark"
      />
    </div>
  );
}

export default PDFViewer;

Requirements

  • React 16.8.0 or higher
  • Modern browser with WebAssembly support

How It Works

This package uses Rust compiled to WebAssembly to power the PDF rendering engine. The WASM module handles:

  1. PDF Parsing - Loading and parsing PDF file structure
  2. Page Rendering - Drawing pages to an HTML canvas
  3. File Operations - Downloading the PDF file

Roadmap

Upcoming features planned for future releases:

| Feature | Description | Status | |---------|-------------|--------| | 🔍 Text Search | Search for text within PDFs with highlighting | Planned | | 🖍️ Highlights | Select and highlight text with multiple colors | Planned | | 📝 Sticky Notes | Add notes to selected text | Planned | | 💾 Annotations Persistence | Save/load highlights and notes via callbacks | Planned | | 🔎 Zoom Controls | Zoom in/out functionality | Planned |


License

MIT © codeninja-404