@bernierllc/email-calendar

中文文档
0.6.0发布于 2026/05/20PROPRIETARYTypeScriptCommonJS近 30 天下载 2396

iCalendar (RFC 5545) generation and parsing for email calendar invites and responses

原始使用文档
文档目录9 节
  1. Installation
  2. Usage
  3. Exports
  4. Provider Capability Support
  5. Capability Levels by Provider
  6. How It Works
  7. Degradation Behavior
  8. No Override Needed
  9. License

@bernierllc/email-calendar

iCalendar (RFC 5545) generation and parsing for email calendar invites and responses. Generates .ics files and converts them to email attachments compatible with all email providers.

Installation

npm install @bernierllc/email-calendar

Usage

import { generateICS, parseICS, toEmailAttachment } from '@bernierllc/email-calendar';

// Generate a calendar invite
const ics = generateICS({
  summary: 'Team Standup',
  start: new Date('2026-03-01T09:00:00Z'),
  end: new Date('2026-03-01T09:30:00Z'),
  organizer: { name: 'Jane', email: '[email protected]' },
  attendees: [
    { name: 'Bob', email: '[email protected]' },
  ],
  location: 'Conference Room A',
});

// Convert to an email attachment
const attachment = toEmailAttachment(ics, {
  filename: 'invite.ics',
  method: 'REQUEST',
});

// Parse an incoming ICS file
const event = parseICS(icsString);
console.log(event.summary, event.start, event.end);

Exports

  • generateICS() -- create iCalendar content from event parameters
  • parseICS() -- parse iCalendar content into structured event data
  • toEmailAttachment() -- convert ICS content to an email-ready attachment object
  • CalendarError -- custom error class with error codes
  • Types: CalendarEvent, CalendarAttendee, CalendarOrganizer, ICSGenerateOptions, ICSParseResult, and more

Provider Capability Support

This section documents how calendar invites behave across email providers, based on the canonical CAPABILITY_MATRIX in @bernierllc/email-manager.

Capability Levels by Provider

ProvidercalendarInvitescalendarEventMgmtNotes
SendGridplatformplatformICS attached to SendGrid emails
MailgunplatformplatformICS attached to Mailgun emails
PostmarkplatformplatformICS attached to Postmark emails
SESplatformplatformICS attached to SES emails
SMTPplatformplatformICS attached to SMTP emails

How It Works

Calendar invites are implemented entirely at the platform level for all providers. This package:

  1. Generates RFC 5545-compliant iCalendar (.ics) content
  2. Converts the ICS content into a MIME attachment using @bernierllc/email-attachments
  3. The attachment is then sent as part of a regular email through any provider

No provider has a native calendar invite API. The ICS file format is a universal standard that email clients (Outlook, Gmail, Apple Mail, Thunderbird, etc.) recognize and process natively, regardless of which email provider sent the message.

Degradation Behavior

There is no degradation. Calendar invites work identically across all providers because the feature is entirely provider-independent. The ICS file is a standard email attachment -- any provider that can send attachments (all of them) supports calendar invites.

No Override Needed

Since this feature operates at the platform level for all providers and produces a universal file format, there are no provider-specific behaviors to override. The output is always a standards-compliant .ics file attached to the email.

License

Copyright (c) 2025 Bernier LLC. All rights reserved.

This package is licensed to the client under a limited-use license. The client may use and modify this code only within the scope of the project it was delivered for. Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.

版本与发布记录

@bernierllc/email-calendar 共发布 7 个版本,首次发布于 2026/02/22;过去 12 个月发布了 7 个版本。

版本发布日期距今
0.6.0latest2026/05/205 个月前
0.4.02026/05/205 个月前
0.3.02026/05/205 个月前
0.2.12026/03/107 个月前
0.2.02026/03/048 个月前
0.1.02026/03/048 个月前

关于 @bernierllc/email-calendar 的常见问题

@bernierllc/email-calendar 是什么?

iCalendar (RFC 5545) generation and parsing for email calendar invites and responses

如何安装 @bernierllc/email-calendar?

在项目目录运行 npm install @bernierllc/email-calendar,或使用 pnpm add / yarn add / bun add。

@bernierllc/email-calendar 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bernierllc/email-calendar 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bernierllc/email-calendar 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bernierllc/email-calendar 可以商用吗?

@bernierllc/email-calendar 使用 PROPRIETARY 许可。声明的许可为 PROPRIETARY,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@bernierllc/email-calendar 的下载量有多少?

根据 npm 官方下载统计,@bernierllc/email-calendar 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,396 次,日均约 80 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bernierllc/email-calendar 还在维护吗?

最新版本 0.6.0 发布于 2026/05/20(5 个月前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/02/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。