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

inbox-beam

v0.1.0

Published

Beam app notifications straight into your own mailbox via IMAP APPEND — no SMTP, no SPF/DKIM/DMARC.

Readme

inbox-beam

Put notifications into your own mailbox without sending email.

To send yourself a contact-form alert or a cron failure, you normally set up a sending domain, SPF, DKIM, DMARC, and a provider like SES or SendGrid. None of that is needed to reach your own inbox.

inbox-beam uses the IMAP APPEND command to write a message directly into your mailbox. No SMTP, no sending domain, no deliverability.

import { InboxBeam } from "inbox-beam";

const beam = new InboxBeam({
  host: "imap.gmail.com",
  auth: { user: "[email protected]", pass: process.env.IMAP_APP_PASSWORD },
});

await beam.beam({ subject: "New contact", text: "someone submitted the form" });

The message lands in your inbox, unread and searchable. Nothing was sent.

This is not email delivery

inbox-beam appends to a mailbox you already control. It does not send mail and cannot reach anyone else. To email a user or customer, use SMTP or a delivery API. It also keeps no send log and the date is set by the client, so don't use it where an audit trail matters. It's for your own notifications.

Install

npm install inbox-beam

Or from GitHub (builds on install):

npm install github:toyoshi/inbox-beam

Node.js >= 18.

Usage

import { InboxBeam } from "inbox-beam";

const beam = new InboxBeam({
  host: "imap.gmail.com",
  auth: { user: "[email protected]", pass: process.env.IMAP_APP_PASSWORD },
  mailbox: "INBOX",            // or a label/folder
  subjectPrefix: "[my-app]",   // optional
});

await beam.beam({ subject: "Cron failed", text: "nightly-export exited 1" });

HTML plus text produces a multipart/alternative message:

await beam.beam({
  subject: "Weekly report",
  text: "Signups: 42",
  html: "<h1>Weekly report</h1><p>Signups: 42</p>",
});

Override the target mailbox per call:

await beam.beam({ subject: "New signup", text: "...", mailbox: "App Notifications" });

Gmail setup

  1. Enable IMAP in Gmail settings.
  2. Turn on 2-Step Verification and create an App Password.
  3. Use it as auth.pass.

Workspace admins can disable app passwords. In that case pass an OAuth2 token as auth.accessToken instead of pass. A dedicated notify@ account that forwards to you is safer than your primary account's credentials on a server.

API

new InboxBeam(options)

| Option | Type | Default | Notes | | --- | --- | --- | --- | | host | string | — | IMAP host, e.g. imap.gmail.com. | | auth | { user, pass?, accessToken? } | — | App password or OAuth2 token. | | port | number | 993 | | | secure | boolean | true | Use TLS. | | mailbox | string | "INBOX" | Target mailbox or label. | | from | string | auth.user | Default From. | | to | string | auth.user | Default To. | | unread | boolean | true | Leave appended messages unread. | | subjectPrefix | string | — | Prepended to every subject. |

beam.beam(input)

input: subject (required), text, html, from, to, mailbox, unread. Per-call fields override the constructor defaults.

Returns { mailbox, uid?, uidValidity? }. The uid comes from the server's APPENDUID response.

buildMessage(input)

The RFC 5322 builder is exported on its own if you want the raw message without the IMAP connection. Zero dependencies, UTF-8 safe.

import { buildMessage } from "inbox-beam";
const raw = buildMessage({ from: "[email protected]", to: "[email protected]", subject: "Hi", text: "Body" });

When to use it

Use it for notifications only you or your team read: contact-form copies, error alerts, job logs, small tools where standing up email sending isn't worth it.

Don't use it to email third parties, or where you need delivery receipts, bounce handling, or an audit trail.

How it works

IMAP's APPEND command (RFC 9051 §6.3.12) adds a message to the end of a mailbox. It's the same command mail clients use to save sent copies and drafts. inbox-beam builds an RFC 5322 message and appends it over a TLS IMAP connection using imapflow.

License

MIT