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

piconv

v1.0.1

Published

A pdf and image processing library

Readme

piconv

npm

A lightweight TypeScript library for converting PDF and image files to Base64, Hex, and ASCII85 encodings, and back.

Features

  • Convert PDF files to/from Base64, Hex, and ASCII85
  • Convert image files to/from Base64, Hex, and ASCII85
  • Simple API with synchronous file operations
  • TypeScript support with full type definitions
  • Zero external dependencies (uses Node.js built-ins)

Installation

npm install piconv

Usage

PDF Conversions

import { pdfToBase64, base64ToPdf, pdfToHex, hexToPdf, pdfToAscii85, ascii85ToPdf } from 'piconv';

// Convert PDF to Base64
const base64String = pdfToBase64('path/to/document.pdf');

// Convert Base64 back to PDF
base64ToPdf(base64String, 'path/to/output.pdf');

// Convert PDF to Hex
const hexString = pdfToHex('path/to/document.pdf');

// Convert Hex back to PDF
hexToPdf(hexString, 'path/to/output.pdf');

// Convert PDF to ASCII85
const ascii85String = pdfToAscii85('path/to/document.pdf');

// Convert ASCII85 back to PDF
ascii85ToPdf(ascii85String, 'path/to/output.pdf');

Image Conversions

import { imageToBase64, base64ToImage, imageToHex, hexToImage, imageToAscii85, ascii85ToImage } from 'piconv';

// Convert image to Base64 (includes MIME type prefix)
const base64String = imageToBase64('path/to/image.jpg');

// Convert Base64 back to image
base64ToImage(base64String, 'path/to/output.jpg');

// Convert image to Hex
const hexString = imageToHex('path/to/image.jpg');

// Convert Hex back to image
hexToImage(hexString, 'path/to/output.jpg');

// Convert image to ASCII85
const ascii85String = imageToAscii85('path/to/image.jpg');

// Convert ASCII85 back to image
ascii85ToImage(ascii85String, 'path/to/output.jpg');

API Reference

PDF Functions

  • pdfToBase64(path: string): string - Converts PDF file to Base64 string
  • base64ToPdf(base64: string, outputPath: string): void - Converts Base64 string back to PDF file
  • pdfToHex(path: string): string - Converts PDF file to Hex string
  • hexToPdf(hex: string, outputPath: string): void - Converts Hex string back to PDF file
  • pdfToAscii85(path: string): string - Converts PDF file to ASCII85 string
  • ascii85ToPdf(ascii85: string, outputPath: string): void - Converts ASCII85 string back to PDF file

Image Functions

  • imageToBase64(path: string): string - Converts image file to Base64 string with MIME type prefix
  • base64ToImage(base64: string, outputPath: string): void - Converts Base64 string back to image file
  • imageToHex(path: string): string - Converts image file to Hex string
  • hexToImage(hex: string, outputPath: string): void - Converts Hex string back to image file
  • imageToAscii85(path: string): string - Converts image file to ASCII85 string
  • ascii85ToImage(ascii85: string, outputPath: string): void - Converts ASCII85 string back to image file

Requirements

  • Node.js 14+
  • TypeScript 4.0+ (for development)

Testing

Run the test suite:

npm test

Tests include round-trip conversions for all supported formats.

Build

Build the project:

npm run build

This generates CommonJS and ESM builds in the dist/ directory.

Contributing

  1. Fork the repository: https://github.com/Viswesh934/PICONV
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run npm test to ensure all tests pass
  6. Submit a pull request

License

ISC

Author

Viswesh934