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

leading-to-change-pdf-generator

v1.0.3

Published

A TypeScript library for generating professional PDF reports with modular architecture

Readme

Leading to Change PDF Generator

A TypeScript library for generating professional PDF reports with a modular architecture, designed specifically for organizational change management reporting.

Features

  • 🏗️ Modular Architecture: Component-based system for reusable PDF elements
  • 📊 Rich Content: Tables, charts, headers, footers, and formatted text
  • 🎨 Professional Styling: Consistent color schemes and typography
  • 📱 Responsive Layout: Automatic page breaks and content flow
  • 🔧 TypeScript Support: Full type safety and IntelliSense
  • 📄 Multiple Output Formats: File save or ArrayBuffer return
  • 🎯 Extensible: Easy to add new sections and components

Installation

npm install leading-to-change-pdf-generator

Quick Start

import generatePDF from "leading-to-change-pdf-generator";
import { IChangeReport } from "leading-to-change-pdf-generator/models/types";

const reportData: IChangeReport = {
  reportId: "CHG-2025-001",
  organizationId: "ORG-ABC123",
  reportVersion: 1,
  reportType: "Quarterly Change Report",
  createdDate: "2025-01-15T10:30:00Z",
  title: "Q4 2024 Change Management Report",
  organizationName: "Acme Corporation",
  // ... more data
};

// Generate PDF file
generatePDF(reportData);

// Or get as buffer for web applications
const pdfBuffer = generatePDF(reportData, true);

Development

Prerequisites

  • Node.js 16+
  • npm or yarn

Setup

# Clone and install dependencies
git clone <repository-url>
cd leading-to-change-pdf-generator
npm install

Development Scripts

# Run development with sample data
npm run dev

# Run tests
npm run test

# Build for production
npm run build

# Test built package
npm run built-test

# Clean build artifacts
npm run clean

Project Structure

src/
├── components/          # Reusable PDF drawing components
│   ├── drawHeadingText.ts
│   ├── drawParagraph.ts
│   ├── drawTable.ts
│   ├── drawHeader.ts
│   └── drawFooter.ts
├── content/            # Content generation modules
│   ├── overview.content.ts
│   └── initiatives.content.ts
├── helpers/            # Utility functions
│   └── general.helpers.ts
├── models/             # TypeScript interfaces
│   └── types.ts
├── resources/          # Static resources
│   └── colors.ts
├── setup/              # PDF document setup
│   ├── addFonts.ts
│   └── addPage.ts
└── index.ts           # Main entry point

Architecture

Components

Drawing components are reusable functions that render specific PDF elements:

  • drawHeadingText: Styled headings (h1-h4)
  • drawParagraph: Text with wrapping and alignment
  • drawTable: Structured data tables
  • drawHeader/Footer: Page headers and footers

Content Modules

Content modules generate complete report sections:

  • overview.content.ts: Organization info and executive summary
  • initiatives.content.ts: Change initiative details
  • Add more modules for stakeholders, assessments, metrics, etc.

Helpers

Utility functions for common operations:

  • Page management and layout
  • Text wrapping and measurement
  • Color and styling utilities
  • Date/number formatting

Data Model

Comprehensive TypeScript interfaces define the expected data structure for change management reports.

Customization

Adding New Sections

  1. Create a new content module in src/content/
  2. Import and call it in src/index.ts
  3. Add corresponding data interfaces in src/models/types.ts

Styling

Modify colors and styling in src/resources/colors.ts:

export const colors = {
  primary: "#2E86AB",
  secondary: "#F18F01",
  // ... customize colors
};

Custom Components

Create new drawing components following the pattern:

const drawCustomComponent = (doc: jsPDF, x: number, y: number, data: any, options: ICustomOptions = {}): number => {
  // Implementation
  return heightConsumed;
};

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

For questions and support, please open an issue on GitHub.