@sebse-tools/ics-parser
v2.0.1
Published
Full RFC 5545 iCalendar implementation. Parse, prepare, expand, and query .ics data with complete RRULE support, DST-aware timezone resolution, and serialize/deserialize caching
Readme
@sebse-tools/ics-parser
Full RFC 5545 iCalendar implementation. Parse, prepare, expand, and query .ics data with complete RRULE support, DST-aware timezone resolution, and serialize/deserialize caching
This package is a complete TypeScript implementation of RFC 5545 for parsing, preparing, and querying iCalendar (.ics) data. It exposes a low-level, composable API that can be consumed by any application needing structured calendar event data.
Key Features
- Two-Phase Processing:
prepare()parses raw ICS strings into a structuredPreparedIcsobject (VEVENT components + timezone map).getEventsBetween()then expands that data for a given UTC time range — enabling efficient caching between the two steps. - Serialize / Deserialize:
serialize()anddeserialize()convertPreparedIcsto/from JSON, allowing prepared data to be stored and reloaded without re-parsing. - Full RFC 5545 RRULE Expansion: Recurring events are expanded via a generator-based engine with complete support for
FREQ,INTERVAL,COUNT,UNTIL,BYDAY,BYMONTHDAY,BYMONTH,BYWEEKNO,BYYEARDAY,BYSETPOS,WKST,RDATE, andEXDATE. - DST-Aware Timezone Resolution: VTIMEZONE components are processed into transition tables. UTC offsets are resolved correctly across DST boundaries, including ambiguous (fall-back) and non-existent (spring-forward) local times.
- Windows Timezone Support: Non-IANA timezone identifiers (e.g.,
Eastern Standard Time) are resolved to IANA equivalents viawindows-iana. - Unexpanded Event Access:
getUnexpandedEvents()returns parsed but non-expanded events — useful for search without generating all recurrence instances. - RFC 5545 Exception Handling: Recurring event overrides (
RECURRENCE-ID) and exclusions (EXDATE) are correctly applied per UID group during full calendar expansion.
Recent Changes
Version 2.0.0
- 6e9bfb2: rename monorepo and unscope n8n package
Version 1.0.2
- 288bd1d: remove redundant .gitignore and format readme
Version 1.0.1
- 942044b: update tests to pass random number generator
Authors
- sebse
License
This project is licensed under the AGPL-3.0-only License. See the LICENSE file for details.
