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

@sullux/email-client

v1.0.0

Published

Zero-dependency, local-first IMAP/SMTP email client and MIME parser/composer.

Readme

@sullux/coms-email

A pure, zero-dependency, programmatic email engine for Node.js. It features robust, state-machine TLS clients for secure SMTP transmissions and IMAP sync/listening operations alongside a pure recursive MIME compiler.


Architectural Role

@sullux/coms-email contains no binaries and is entirely decoupled from any CLI wrappers or Event Lake storage mechanics. It is designed to be imported directly into other JS/TS applications (like CLI commands, web services, or background daemons) that require robust email protocol capability with zero third-party dependencies.

       [ Client JS Application ]
          │                  │
   (Instantiates)      (Instantiates)
          ▼                  ▼
     [ SMTP Client ]    [ IMAP Client ]

Core Capabilities:

  • Zero SaaS Intermediaries: Implements standard SMTP and IMAP handshakes using Node's native node:tls capabilities, avoiding heavy packages like nodemailer.
  • Stateful IMAP IDLE: Houses a resilient, reconnectable socket state machine to enter and monitor IMAP IDLE streams.
  • Recursive MIME Compiler: Generates clean, RFC-compliant multipart email streams—combining plaintext, HTML, inline visual references (multipart/related), and physical file attachments (multipart/mixed) inside a single pure utility function.

Quick Start

1. Installation

yarn add @sullux/coms-email

2. Composing and Sending via SMTP

const { Smtp } = require('@sullux/coms-email')

const smtp = Smtp({
  host: 'smtp.fastmail.com',
  port: 465,
  username: '[email protected]',
  password: 'my-app-password',
})

async function sendMail() {
  const receipt = await smtp.send({
    from: '[email protected]',
    to: '[email protected]',
    cc: '[email protected]',
    subject: 'Status Report',
    text: 'Hello world',
    html: '<h3>Hello world</h3>',
  })
  console.log('Transmitted! Message-ID:', receipt.messageId)
}
sendMail()

API Reference

Imap(config)

Provides state-machine connectivity to secure IMAP servers.

  • sync({ folder = 'INBOX', lastUid = 0 }): Queries, fetches, unfolds, and structures headers and bodies of all messages with a UID greater than lastUid. Returns Promise<Array<Message>>.
  • listen({ onNewMail, folder = 'INBOX' }): Opens a persistent socket connection and registers IMAP IDLE. Whenever a new email arrives, onNewMail() is called. Handles internal heartbeats and self-healing reconnections. Returns { close() }.

Smtp(config)

A secure SMTP client.

  • send(email): Sequentially transmits envelope headers (RCPT TO for To, CC, and BCC lists) to ensure BCC stealth, builds the MIME payload, and pipes it through the TLS socket. Returns Promise<{ messageId }>.

compiledMimeMessage(options)

A pure function that compiles a standardized JS email object into a raw RFC-compliant MIME string.

const { compiledMimeMessage } = require('@sullux/coms-email')

const rawMime = compiledMimeMessage({
  from: 'Charles <[email protected]>',
  to: 'Natasha <[email protected]>',
  subject: 'Docs',
  text: 'Hello',
  files: [{
    fileId: 'doc-1',
    filename: 'statement.pdf',
    mimeType: 'application/pdf',
    disposition: 'attachment',
    base64: '...'
  }]
})