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

imessage-history

v0.1.0

Published

TypeScript tool to analyze iMessage history

Readme

iMessage History Analyzer

A TypeScript tool to analyze your iMessage history, search messages, and export conversations.

Prerequisites

  • macOS
  • Node.js 18+
  • Terminal access (iTerm2, Ghostty, etc.)

Setup

  1. Clone the repository and install dependencies:
git clone <repo-url>
cd imessage-history
npm install
  1. Grant Full Disk Access to your terminal:
    • Open System Settings
    • Navigate to Privacy & Security → Full Disk Access
    • Click the + button
    • Add your terminal application (e.g., iTerm2, Ghostty)
    • Restart your terminal

This step is required because macOS protects the iMessage database. Your terminal needs Full Disk Access to read the chat.db file.

  1. Grant Contacts Access:
    • When you first run the tool, macOS will show a dialog asking for permission to access your Contacts
    • Click "OK" to allow access
    • This is required for mapping phone numbers/emails to contact names
    • If you deny access, the tool will still work but will only show phone numbers/emails instead of contact names

Usage

The tool provides a command-line interface with the following commands:

# Show help and available commands
imessage help

# List all contacts with message history
imessage contacts

# Search messages by name
imessage search "John Smith"

# Search by phone number
imessage search "+12345678900"

# Search by email
imessage search "[email protected]"

Search Options

# Show oldest messages first (chronological order)
imessage search "John" --asc

# Show all messages (no limit)
imessage search "John" --no-limit

# Limit to specific number of messages
imessage search "John" --limit=500

# Export messages to CSV
imessage search "John" --csv

# Export to specific CSV file
imessage search "John" --csv=john-messages.csv

# Combine options
imessage search "John" --no-limit --asc --csv=full-history.csv

Cache Management

The tool caches contact information for better performance. To refresh:

# Clear contact cache and rebuild
imessage search --refresh-cache

Features

  • 🔍 Search messages by contact name, phone number, or email
  • 📱 Automatic contact name resolution
  • 📅 Chronological or reverse-chronological ordering
  • 📊 Export conversations to CSV
  • 📎 Track attachments and group chats
  • 🚀 Fast searching with contact caching

Security Note

This tool operates in read-only mode and never modifies your message database. All data stays on your machine.

License

MIT