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

whatsapp-chat-to-pdf

v0.1.0

Published

Convert an exported WhatsApp chat (_chat.txt or .zip) into a clean, styled PDF — CLI + library.

Readme

whatsapp-chat-to-pdf

Convert an exported WhatsApp chat (_chat.txt or .zip) into a clean, styled PDF — from the command line.

A small, dependency-light tool for turning a WhatsApp chat export into a readable PDF document. Available as a Python package (pip install whatsapp-chat-to-pdf) and a Node / npm package (npx whatsapp-chat-to-pdf). Works offline, on your own machine — your conversations never leave your computer.

💡 Don't want to install anything? If you'd rather drop in a chat export and get a media-rich PDF in your browser — with images, voice notes, emoji and pixel-perfect WhatsApp formatting — use the hosted converter at chattopdf.app. This CLI covers the text/offline case; the web app covers everything else.


Why this exists

Most open-source WhatsApp exporters output raw HTML or JSON. This one is built for the most common real-world need: a tidy PDF you can read, print, archive or email — a chat log, a keepsake, or a record for your files.

The hard part of parsing WhatsApp exports is that the _chat.txt timestamp format changes by device, locale and language. This parser handles 14 timestamp formats out of the box, including:

  • iOS bracketed — [2024/07/09, 08:01:49] Name: … and [2026-03-02, 6:39:22 AM] …
  • Android dashed — 3/15/24, 2:30 PM - Name: …
  • European dotted — 15.03.2024, 14:30 - Name: …
  • Dutch / Brazilian / Spanish iOS / ISO variants
  • Non-Western numerals (Arabic, Persian, Devanagari/Hindi, Thai)
  • CJK / Arabic / Persian AM-PM markers (上午/下午, 午前/午後, 오전/오후, ص/م, ق.ظ/ب.ظ)

It also correctly classifies media, calls, deleted and system messages, stitches multi-line messages back together, and skips the macOS ._chat.txt resource-fork that silently corrupts many other parsers.

Install & use

Python

pip install whatsapp-chat-to-pdf
whatsapp-chat-to-pdf _chat.txt -o my-chat.pdf

Or use it as a library:

from whatsapp_chat_to_pdf import parse_file, render

chat = parse_file("WhatsApp Chat with Alice.zip")
print(chat.message_count, "messages from", chat.participants)
render(chat, "alice.pdf", title="Chat with Alice")

Node / npm

npx whatsapp-chat-to-pdf _chat.txt -o my-chat.pdf
# or: npm i -g whatsapp-chat-to-pdf
import { parseText, render } from "whatsapp-chat-to-pdf";
const chat = parseText(fs.readFileSync("_chat.txt", "utf8"));
await render(chat, "out.pdf", { title: "Chat with Alice" });

How to get the _chat.txt export from WhatsApp

  1. Open the chat → tap the contact/group name.
  2. Scroll down → Export ChatWithout Media (or With Media for the .zip).
  3. Save the .txt/.zip to your computer.
  4. Run the command above.

(Full step-by-step with screenshots for iPhone & Android: chattopdf.app guide.)

Scope

| | This CLI | chattopdf.app (hosted) | |---|:---:|:---:| | Text → styled PDF, offline | ✅ | ✅ | | 14 locale/date formats | ✅ | ✅ | | Inline images & media | — | ✅ | | Voice-note transcription | — | ✅ | | Full emoji & CJK glyphs | — | ✅ | | No install, runs in browser | — | ✅ |

Emoji and CJK render as the bundled DejaVu font allows; for full fidelity use the hosted version.

Contributing

Issues and PRs welcome — especially new timestamp formats from locales not yet covered. Drop a sample of the offending _chat.txt header line in an issue.

License

MIT — see LICENSE.