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

@flightdev/email

v0.0.7

Published

Email adapters for Flight Framework - Resend, SendGrid, SMTP

Readme

@flightdev/email

Email sending for Flight Framework. Unified API for multiple email providers.

Table of Contents


Installation

npm install @flightdev/email

Quick Start

import { createEmail } from '@flightdev/email';
import { resend } from '@flightdev/email/resend';

const email = createEmail(resend({
    apiKey: process.env.RESEND_API_KEY,
}));

await email.send({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Welcome!',
    html: '<h1>Welcome to our platform!</h1>',
});

Adapters

Resend

Modern email API with React support.

import { resend } from '@flightdev/email/resend';

const adapter = resend({
    apiKey: process.env.RESEND_API_KEY,
});

Postmark

Transactional email service.

import { postmark } from '@flightdev/email/postmark';

const adapter = postmark({
    serverToken: process.env.POSTMARK_SERVER_TOKEN,
});

SendGrid

Scalable email delivery.

import { sendgrid } from '@flightdev/email/sendgrid';

const adapter = sendgrid({
    apiKey: process.env.SENDGRID_API_KEY,
});

AWS SES

Amazon Simple Email Service.

import { ses } from '@flightdev/email/ses';

const adapter = ses({
    region: 'us-east-1',
    credentials: {
        accessKeyId: process.env.AWS_ACCESS_KEY_ID,
        secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
    },
});

SMTP

Any SMTP server.

import { smtp } from '@flightdev/email/smtp';

const adapter = smtp({
    host: 'smtp.example.com',
    port: 587,
    secure: false,
    auth: {
        user: 'username',
        pass: 'password',
    },
});

Sending Emails

Basic Email

await email.send({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Hello',
    text: 'Plain text content',
    html: '<p>HTML content</p>',
});

Multiple Recipients

await email.send({
    from: '[email protected]',
    to: ['[email protected]', '[email protected]'],
    cc: ['[email protected]'],
    bcc: ['[email protected]'],
    subject: 'Team Update',
    html: '<p>...</p>',
});

Attachments

await email.send({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Your Invoice',
    html: '<p>Please find your invoice attached.</p>',
    attachments: [
        {
            filename: 'invoice.pdf',
            content: pdfBuffer,
            contentType: 'application/pdf',
        },
    ],
});

Templates

React Email (with Resend)

import { render } from '@react-email/render';
import { WelcomeEmail } from './emails/welcome';

const html = render(<WelcomeEmail username="John" />);

await email.send({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Welcome!',
    html,
});

API Reference

email.send(options)

| Option | Type | Description | |--------|------|-------------| | from | string | Sender email address | | to | string \| string[] | Recipient(s) | | subject | string | Email subject | | html | string | HTML body | | text | string | Plain text body | | cc | string[] | CC recipients | | bcc | string[] | BCC recipients | | replyTo | string | Reply-to address | | attachments | Attachment[] | File attachments |

Attachment

| Property | Type | Description | |----------|------|-------------| | filename | string | File name | | content | Buffer \| string | File content | | contentType | string | MIME type |


License

MIT