← All packages

@lacspace/ics

v1.0.0Mail Kit0 deps

Small, correct iCalendar (RFC 5545) + iTIP (RFC 5546) parser and builder for webmail meeting invites. parseIcs() reads Google Calendar, Outlook/Exchange and Apple invites: line unfolding (byte-level, so folds that split UTF-8 characters survive), quoted parameters, text escaping, DATE vs DATE-TIME, UTC/floating/TZID times converted to UTC via Intl (IANA names, 60+ Windows zone names like "Nepal Standard Time", custom VTIMEZONE rules), DST gaps/overlaps per RFC 5545, DURATION, attendees, organizer, VALARM, RRULE/EXDATE/RDATE passthrough, RECURRENCE-ID overrides, Google Meet/Teams links. buildIcs() writes CRLF calendars folded at 75 octets (never splitting a multibyte character) with optional TZID + VTIMEZONE. buildReplyIcs() / replyEmail() produce RFC 5546 METHOD:REPLY RSVPs (Accept/Decline/Tentative); buildCancelIcs() cancels. Never throws on malformed input. Zero dependencies; Node 18+, edge runtimes and browsers.

npm i @lacspace/ics

Usage

ics.ts
import { parseIcsEvent, replyEmail, buildIcs } from "@lacspace/ics";

const ev = parseIcsEvent(icsText);
// { uid: "040000008200E…", sequence: 2, summary: "Sprint review",
//   start: "2026-10-20T08:15:00Z", end: "2026-10-20T09:15:00Z", allDay: false,
//   startTzid: "Nepal Standard Time", organizer: { name: "Shrestha, Anil", address: "anil@contoso.com" },
//   attendees: [{ name: "Sita Rai", address: "sita@contoso.com", role: "REQ-PARTICIPANT", partstat: "NEEDS-ACTION", rsvp: true }],
//   conference: "https://teams.microsoft.com/l/meetup-join/…", alarms: [{ action: "DISPLAY", trigger: "-PT15M" }], … }

const rsvp = replyEmail(ev!, { address: "sita@contoso.com" }, "ACCEPTED");
// { subject: "Accepted: Sprint review", to: "anil@contoso.com", text, ics,
//   contentType: "text/calendar; method=REPLY; charset=UTF-8", filename: "invite.ics" }

Exports 17

DEFAULT_PRODIDWINDOWS_TIMEZONESbuildCancelIcsbuildIcsbuildReplyIcsbuildVTimezoneescapeTextfoldparseContentLineparseDateTimeparseDurationparseIcsparseIcsEventreplyEmailresolveZoneunescapeTextunfold

Keywords

icsicalendaricalrfc5545rfc5546itip

More in Mail Kit

@lacspace/email-templates

Compose bulletproof, responsive, dark-mode HTML emails from simple blocks, plus 13 ready-made transactional templates (OTP, verify, password-reset, magic-link, receipt, order, shipping, invitation, digest, announcement). Ships plaintext generation, preheaders and {{var}} i18n interpolation. Zero-dependency, isomorphic.

@lacspace/email-validate

Smart, network-free email validation — RFC-5322 syntax (incl. quoted local parts & IP-literal domains), disposable/temp-mail & role-account detection, free-provider flags, Gmail normalization and 'did you mean?' typo suggestions. Zero-dependency, isomorphic.

@lacspace/email-verify

Best-effort email deliverability for Node — syntax + disposable/role, MX lookup with priority ranking, an optional SMTP RCPT probe (no mail sent), catch-all detection, a 0-100 confidence score, and de-duped batch verification. All DNS/SMTP injectable; zero npm dependencies.

@lacspace/mailer

A tiny zero-dependency SMTP client for Node — send email over raw net/tls with STARTTLS & AUTH, plus a fluent MIME builder (inline images, attachments, alternatives), RFC 5322 address + RFC 2047 helpers, batch send with retry, and no-network test transports. Provider presets (Hostinger, Gmail, Outlook, Zoho…) make setup one line.

@lacspace/imap

Zero-dependency IMAP4rev1 client for Node (RFC 3501 + IDLE, MOVE, UIDPLUS, CONDSTORE, SPECIAL-USE, LIST-EXTENDED, LITERAL+, SASL-IR, QUOTA, ID). Implicit TLS and STARTTLS with verification on, LOGIN / PLAIN / XOAUTH2 / OAUTHBEARER, streaming byte-accurate parser, async-iterable FETCH, envelopes with RFC 2047 decoding, BODYSTRUCTURE trees shared with @lacspace/mime, modified UTF-7 mailbox names, special-use detection (incl. Gmail XLIST and localised names), IDLE with NOOP fallback. Works with Hostinger (Dovecot), Gmail, Outlook/Exchange, GoDaddy.

@lacspace/mime

Isomorphic RFC 5322 / RFC 2045-2049 MIME parser and builder for webmail. parseMime() turns raw mail (string or bytes) into from/to/cc/subject/date/text/html/attachments/inline cid images/priority/List-Unsubscribe one-click and the part tree; handles nested multipart (mixed, alternative, related, report, signed), message/rfc822 forwards, base64 and quoted-printable (tolerant), RFC 2047 encoded words (split multibyte, adjacent whitespace), RFC 2231 parameters, 30+ charsets and malformed input without ever throwing. parseBodyStructure() parses IMAP BODYSTRUCTURE (literals, extension data) into the same tree with IMAP partIds, plus findTextParts / listAttachments / decodePart for lazy fetching. buildMime() writes CRLF messages with encoded-word headers, QP/base64 bodies, mixed/alternative/related nesting, Message-ID generation and header-injection guards; replyHeaders() / forwardSubject() for threading. Pairs with @lacspace/imap and @lacspace/mailer. Zero dependencies; Node 18+, edge runtimes and browsers.