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

@bobfrankston/imail

v1.0.19

Published

Automated email screening and organization for IMAP accounts. Fetches emails by date range, applies rule-based and optional AI classification, and moves messages to appropriate folders.

Readme

imail — IMAP Email Screener

Automated email screening and organization for IMAP accounts. Fetches emails by date range, applies rule-based and optional AI classification, and moves messages to appropriate folders.

Quick Start

tsc                    # compile (or tsc -watch in VS Code)
node index.js          # run with defaults
node index.js -ai cli  # run with AI analysis via Claude CLI

Command-Line Options

| Flag | Description | Default | |------|-------------|---------| | -d <days> | Number of days to process | 10 | | -b <begin> | Start from this many days ago | 1 | | -box <folder> | Folder to use instead of INBOX | INBOX | | -g | Poll Gmail accounts only | all | | -i | Poll IMAP (non-Gmail) accounts only | all | | -ai <mode> | AI analysis mode: api, cli, none | cli | | -noai | Shortcut for -ai none | | | -v | Verbose output | off | | -ignoreCerts | Ignore invalid/expired SSL certificates | on | | -certs | Require valid SSL certificates | |

Architecture

index.ts              Entry point, arg parsing, main loop
imailsettings.ts      Shared settings type (ImailSettings)
screener/
  cleaner.ts          Core processing — fetch, screen, move messages
  screener.ts         Static rule engine
rules/
  rules.ts            Pattern-matching rules (to/from/subject)
analyze/
  analyzer.ts         AI analysis via Anthropic API (api mode)
  clianalyzer.ts      AI analysis via Claude CLI (cli mode, uses Max plan)
  icswriter.ts        Generate .ics calendar files from detected events
html/
  htmlreport.ts       HTML report generation

AI Analysis

Two modes available via -ai <mode>:

  • cli (default) — Spawns claude -p per message. Uses your Claude Max plan (no API charges). Requires claude CLI installed.
  • api — Direct Anthropic API calls. Model configured in ../config/mailsettings.json under ai.model. Costs per-token.
  • none — No AI analysis, rules only.

AI results are cached in ai/analyzed.json keyed by message ID. Delete the file to re-analyze.

VS Code Debugger Note

When running from the VS Code debugger (F5), the NODE_OPTIONS env var contains --inspect flags. The CLI analyzer strips these so the child claude process doesn't inherit them and fail.

Rules

Edit rules/rules.ts to add/modify email screening rules. Rules match on to/from/cc addresses, subject lines, and sender names. Destination "*" means trash.

Configuration

  • Server credentials: ../uinfo module
  • AI settings: ../config/mailsettings.json (ai section)
  • AI guidance: ai/ai.md (custom classification hints)
  • Debug output: y:\temp\imapper
  • CLI analysis logs: logs/ directory