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

email-fast-node

v0.1.0

Published

High-performance email parser for .eml and .msg formats

Readme

email-fast-node

High-performance email parser for .eml and .msg formats.

Features

  • Fast: Memory-mapped files for large mailboxes
  • Multi-format: EML (RFC 5322) and MSG (Outlook) support
  • Complete: Headers, body (text/html), attachments, threading
  • Streaming: Mbox format support for bulk processing
  • Arrow IPC: Export to Apache Arrow format
  • Safe: Rust memory safety guarantees

Installation

npm install email-fast-node

Quick Start

const { parseEmail, extractAttachments } = require('email-fast-node');

// Parse an email file (auto-detects format)
const email = parseEmail('/path/to/message.eml');

console.log('From:', email.from.address);
console.log('Subject:', email.subject);
console.log('Date:', email.date);

// Access body
if (email.body.text) {
  console.log('Text:', email.body.text.substring(0, 200));
}
if (email.body.html) {
  console.log('HTML:', email.body.html.substring(0, 200));
}

// List attachments
for (const attachment of email.attachments) {
  console.log(`Attachment: ${attachment.filename} (${attachment.size} bytes)`);
}

// Extract attachments to directory
const paths = extractAttachments('/path/to/message.eml', './attachments');
console.log('Extracted:', paths);

Options

const email = parseEmail('/path/to/message.eml', {
  maxInflate: 100 * 1024 * 1024,  // Max attachment size (default: 100 MB)
  includeRawHeaders: false,        // Include all headers (default: false)
  htmlToText: false,               // Convert HTML to text (default: false)
  extractAttachmentContent: false, // Include attachment content (default: false)
});

Mbox Processing

Process mailbox files with streaming:

const { parseMboxNdjson, parseMboxArrow } = require('email-fast-node');

// Stream to NDJSON
const count = parseMboxNdjson(
  '/path/to/mailbox.mbox',
  '/tmp/output.ndjson'
);
console.log(`Processed ${count} emails`);

// Export to Apache Arrow
const count = parseMboxArrow(
  '/path/to/mailbox.mbox',
  '/tmp/emails.arrow',
  { batchSize: 10000 }
);

Data Structure

{
  messageId: "<[email protected]>",
  from: {
    name: "John Doe",
    address: "[email protected]"
  },
  replyTo: { name: null, address: "[email protected]" },
  to: [{ name: null, address: "[email protected]" }],
  cc: [],
  bcc: [],
  subject: "Hello World",
  date: "2024-01-15T14:30:00.000Z",
  body: {
    text: "Plain text content...",
    html: "<html>...</html>"
  },
  attachments: [
    {
      filename: "document.pdf",
      contentType: "application/pdf",
      size: 12345,
      contentId: "<attachment1>",
      isInline: false
    }
  ],
  inReplyTo: "<[email protected]>",
  references: ["<[email protected]>"],
  priority: 3
}

TypeScript Support

TypeScript definitions are included:

import { parseEmail, Email, ParseOptions } from 'email-fast-node';

const email: Email = parseEmail('message.eml');

Performance

  • 10x faster than JavaScript email parsers
  • Streaming mbox processing for mailboxes with millions of messages
  • Low memory footprint even for large attachments

Platform Support

Prebuilt binaries available for:

  • macOS (Intel & Apple Silicon)
  • Linux (x64, ARM64)
  • Windows (x64)

License

MIT

Related Packages

  • xlsx-fast-node - Excel (.xlsx) parser
  • docx-fast-node - Word (.docx) parser
  • pptx-fast-node - PowerPoint (.pptx) parser