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

@mcinteerj/moltbot-gmail

v1.1.4

Published

Gmail channel plugin for Moltbot - uses gog CLI for secure Gmail access

Readme

Gmail Channel (Plugin)

Connects Moltbot to Gmail via the gog CLI.

Installation

This is a plugin. To install from source:

moltbot plugins install ./extensions/gmail

Features

  • Polling-based sync: Robustly fetches new unread emails from Inbox.
  • Circuit Breaker: Handles API failures and rate limiting gracefully.
  • Rich Text: Markdown support for outbound emails.
  • Threading: Native Gmail thread support with quoted reply context.
  • Archiving: Automatically archives threads upon reply.
  • Email Body Sanitisation: Automatically cleans incoming email bodies for LLM consumption.

Email Body Sanitisation

Incoming emails are automatically sanitised to produce clean, readable text — no configuration needed.

What It Does

  • HTML-to-text conversion: Strips tags, removes <style> and <script> blocks, filters out tracking pixels, and decodes HTML entities.
  • Footer junk removal: Strips common noise like unsubscribe links, "Sent from my iPhone", and confidentiality notices.
  • Whitespace cleanup: Collapses excessive blank lines and trims leading/trailing whitespace.
  • Signature stripping: Removes content below -- signature separators by default.

Configurable Signature Stripping

Signature stripping is enabled by default. If you need to preserve content after -- separators (e.g. for emails where dashes appear in the body), you can disable it programmatically:

extractTextBody(html, plain, { stripSignature: false })

No plugin configuration is required — sanitisation runs automatically on every inbound message.

Reply Behavior

  • Reply All: When the bot replies to a thread, it uses "Reply All" to ensure all participants are included.
  • Quoted Replies: By default, replies include the full thread history as quoted text (standard Gmail format: "On [date], [author] wrote:"). This can be disabled per-account or globally.
  • Allowlist Gatekeeping: The bot only responds to emails from senders on the allowFrom list. However, if an allowed user includes others (CC) who are not on the allowlist, the bot will still "Reply All", including them in the conversation. This allows authorized users to bring others into the loop.
  • Outbound Restrictions (optional): Use allowOutboundTo and threadReplyPolicy to control who the bot can send emails to. By default, no outbound restrictions are applied (backwards compatible).

Configuration

Add to moltbot.json:

{
  "channels": {
    "gmail": {
      "accounts": {
        "main": {
          "email": "[email protected]",
          "allowFrom": ["*"],
          "includeQuotedReplies": true,  // default: true
          // Optional: restrict who the bot can send emails TO
          "allowOutboundTo": ["@mycompany.com", "[email protected]"],
          "threadReplyPolicy": "allowlist"  // default: "open"
        }
      },
      "defaults": {
        "includeQuotedReplies": true  // global default
      }
    }
  }
}

Configuration Options

| Key | Type | Default | Description | |-----|------|---------|-------------| | includeQuotedReplies | boolean | true | Include thread history as quoted text in replies. Set to false for cleaner, shorter replies. | | allowOutboundTo | string[] | (falls back to allowFrom) | Restrict who the bot can send emails to. Supports exact emails and domain wildcards (e.g., @company.com). | | threadReplyPolicy | string | "open" | Controls thread reply behavior: "open" (no restrictions), "allowlist" (all recipients must be in allowOutboundTo), or "sender-only" (only original thread sender checked). |

Thread Reply Policies

  • open (default): No outbound restrictions. The bot can reply to any thread it was BCCd into. Backwards compatible.
  • allowlist: All thread participants (To, CC, From) must be in allowOutboundTo. Blocks replies if any recipient is not allowed.
  • sender-only: Only checks if the original thread sender is in allowOutboundTo. Useful when you want to reply to threads started by allowed users, even if they CC'd external parties.

Development

Run tests:

npm test
# or
./node_modules/.bin/vitest run src/

Publishing

This repo includes a GitHub Actions workflow for npm publishing.

Automatic (on release)

Create a GitHub release → automatically publishes to npm.

Manual (workflow dispatch)

Go to Actions → "Publish to npm" → Run workflow.

Note: Manual dispatch will:

  1. Bump the version (patch by default, or specify major/minor)
  2. Commit and push the version bump with a tag
  3. Publish to npm

Setup

Add NPM_TOKEN secret to the repository:

  1. Generate token at npmjs.com → Access Tokens → Classic Token (Automation)
  2. Add to repo: Settings → Secrets → Actions → New repository secret