Gathering detailed insights and metrics for ts-ics
Gathering detailed insights and metrics for ts-ics
Gathering detailed insights and metrics for ts-ics
Gathering detailed insights and metrics for ts-ics
npm install ts-ics
Typescript
Module System
Node Version
NPM Version
99.6
Supply Chain
99.5
Quality
92.6
Maintenance
100
Vulnerability
100
License
ts-ics@2.1.8
Updated on Jun 26, 2025
@ts-ics/schema-zod@2.1.8
Updated on Jun 26, 2025
ts-ics@2.1.7
Updated on Jun 06, 2025
@ts-ics/schema-zod@2.1.7
Updated on Jun 06, 2025
ts-ics@2.1.6
Updated on Jun 05, 2025
@ts-ics/schema-zod@2.1.6
Updated on Jun 05, 2025
TypeScript (99.68%)
JavaScript (0.32%)
Total Downloads
2,299,696
Last Day
12,809
Last Week
102,953
Last Month
418,039
Last Year
2,070,409
NOASSERTION License
40 Stars
335 Commits
10 Forks
3 Watchers
1 Branches
7 Contributors
Updated on Jun 29, 2025
Minified
Minified + Gzipped
Latest Version
2.1.8
Package Id
ts-ics@2.1.8
Unpacked Size
190.84 kB
Size
41.18 kB
File Count
7
NPM Version
10.9.2
Node Version
22.16.0
Published on
Jun 26, 2025
Cumulative downloads
Total Downloads
Last Day
4.3%
12,809
Compared to previous day
Last Week
8.6%
102,953
Compared to previous week
Last Month
10.5%
418,039
Compared to previous month
Last Year
803%
2,070,409
Compared to previous year
This library can parse and create Ics files and provides TypeScript types for easy handling and aims to be fully RFC 5545 compliant.
Many of the Ics libraries provide good functionality, but none of them are type safe. This library can parse Ics strings with any validator, thanks to Standard-Schema.
npm i ts-ics
1import { generateIcsCalendar, type IcsCalendar } from "ts-ics"; 2 3const calendar: IcsCalendar = {...} 4 5const icsCalendarString = generateIcsCalendar(calendar);
1import { generateIcsEvent, type IcsEvent } from "ts-ics"; 2 3const event: IcsEvent = {...} 4 5const icsEventString = generateIcsEvent(event);
Non-standard values must be prefixed with X-
. Unhandled non-standard values are automatically prefixed and converted to upper case, and the value is converted to a string.
1type NonStandard = { isCustomer: string } 2 3const calendar: IcsCalendar<NonStandard> = { 4 nonStandard: { isCustomer: "yeah" }, 5 ... 6}; 7 8const calendarString = generateIcsCalendar<NonStandard>(calendar, { 9 nonStandard: { 10 isCustomer: { name: "X-IS-CUSTOMER", generate: (v) => ({ value: v }) }, 11 }, 12});
1import { convertIcsCalendar, type IcsCalendar } from "ts-ics"; 2 3const calendar: IcsCalendar = convertIcsCalendar(undefined, icsCalendarString);
1import { type IcsCalendar } from "ts-ics"; 2import { parseIcsCalendar } from "@ts-ics/schema-zod"; 3 4const calendarParsed: IcsCalendar = parseIcsCalendar(icsCalendarString);
This library uses Standard-Schema under the hood, so every schema library that implements the spec can be used.
1import { convertIcsCalendar, type IcsCalendar } from "ts-ics"; 2import { zIcsCalendar } from "@ts-ics/schema-zod"; 3 4const calendar: IcsCalendar = convertIcsCalendar( 5 zIcsCalendar, 6 icsCalendarString 7);
1import { convertIcsEvent, type IcsEvent } from "ts-ics"; 2 3const event: IcsEvent = convertIcsEvent(undefined, icsEventString);
1import { type IcsEvent } from "ts-ics"; 2import { parseIcsEvent } from "@ts-ics/schema-zod"; 3 4const eventParsed: IcsEvent = parseIcsEvent(icsEventString);
This library uses Standard-Schema under the hood, so every schema library that implements the spec can be used.
1import { convertIcsEvent, type IcsEvent } from "ts-ics"; 2import { zIcsEvent } from "@ts-ics/schema-zod"; 3 4const calendar: IcsEvent = convertIcsEvent(zIcsEvent, icsEventString);
Non-standard values must be prefixed with X-
. Unhandled non-standard values are automatically un-prefixed and converted to camel case, and the value is converted to a string.
1const calendarString = `...
2 X-IS-CUSTOMER:yeah
3 ...`;
4
5const calendar = convertIcsCalendar(undefined, calendarString, {
6 nonStandard: {
7 isCustomer: {
8 name: "X-IS-CUSTOMER",
9 convert: (line) => line.value,
10 schema: z.string(), // optionally provide any validator
11 },
12 },
13});
1import { extendByRecurrenceRule } from "ts-ics"; 2 3const start = new Date(Date.UTC(2023, 9, 5)); 4const ruleString = "FREQ=DAILY;BYMINUTE=15,16,17,18,19;BYSECOND=0,20,40"; 5 6const rule = parseIcsRecurrenceRule(ruleString); 7 8const dates = extendByRecurrenceRule(rule, { 9 start, 10 end: addDays(start, 1), 11});
MIT - License
Thanks to iCalendar.org for the ics documentation and the many examples which are used for testing purposes.
No vulnerabilities found.
No security vulnerabilities found.