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

@jackgreen2018/raffle-ticket

v1.0.0

Published

A lightweight, high-performance raffle ticket sheet generator that runs entirely in the browser or Node.js via Rust/WASM. No server required, no file uploads — 100% client-side with Rust-level speed.

Readme

@jackgreen2018/raffle-ticket

A lightweight, high-performance raffle ticket sheet generator that runs entirely in the browser or Node.js via Rust/WASM. No server required, no file uploads — 100% client-side with Rust-level speed.

Generate printable raffle ticket sheets with ticket numbers, prices, tear stubs, and organization names. Perfect for PTAs, fundraisers, charities, and community events.

Install

npm install @jackgreen2018/raffle-ticket

Usage

import raffleTicket from '@jackgreen2018/raffle-ticket';

// Generate a raffle ticket sheet PDF
const pdfBytes = await raffleTicket.generateTicket({
  event_name: "PTA Fall Fundraiser 2024",
  ticket_count: 30,           // 10-50 tickets
  ticket_size: "letter",      // "letter" (default) or "a4"
  price_per_ticket: 5.00,
  organization: "Lincoln Elementary PTA"
});

// pdfBytes is a Uint8Array containing the PDF
// Save it or display it in the browser
const blob = new Blob([pdfBytes], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);
window.open(url);

Node.js (save to file)

import { writeFile } from 'fs/promises';
import raffleTicket from '@jackgreen2018/raffle-ticket';

const pdfBytes = await raffleTicket.generateTicket({
  event_name: "School Bake Sale",
  ticket_count: 20,
  price_per_ticket: 2.00,
  organization: "Oakville Elementary"
});

await writeFile('raffle-tickets.pdf', Buffer.from(pdfBytes));

API

generateTicket(options)

Returns a Promise<Uint8Array> containing the PDF bytes.

Options:

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | event_name | string | yes | — | Name of the event (e.g., "PTA Fall Fundraiser") | | ticket_count | number | yes | — | Number of tickets (10–50) | | ticket_size | string | no | "letter" | Page size: "letter" (8.5×11 in) or "a4" | | price_per_ticket | number | no | 5.00 | Price per ticket | | organization | string | no | "" | Organization name shown at bottom of tickets |

initialize()

Initialize the WASM runtime. Called automatically on first use.

Performance

Benchmark results comparing @jackgreen2018/raffle-ticket (Rust/WASM) vs pdf-lib (JavaScript):

=== Raffle Ticket Generator Benchmark ===

Options: {
  "event_name": "PTA Fall Fundraiser 2024",
  "ticket_count": 30,
  "ticket_size": "letter",
  "price_per_ticket": 5,
  "organization": "Lincoln Elementary PTA"
}

--- Results ---
Library              | Time (ms) | Size (bytes) | Pages
---------------------|-----------|--------------|------
@jackgreen2018/raffle-ticket |      3.8 |         9198 | 1
pdf-lib              |     24.7 |         1671 | 1

--- Summary ---
WASM speedup: 6.55x faster
WASM size: 550.4% of pdf-lib size

WASM speedup: 6.55x faster than pdf-lib for equivalent ticket generation.

One-Time Pricing vs RaffleBrite

| Feature | RaffleBrite | @jackgreen2018/raffle-ticket | |---------|-------------|------------------------------| | Monthly cost | $29/mo | $0 | | Annual cost | $348/year | $0 | | Client-side | No (server upload) | Yes (browser-based) | | Privacy | Data on their servers | Stays on your device | | Customization | Limited templates | Full control | | Integration | Web app only | npm package, works anywhere |

Break-even: After ~12 months of RaffleBrite ($348), this library pays for itself with a single free use.

License

MIT