Gathering detailed insights and metrics for @timurcravtov/ts-ics
Gathering detailed insights and metrics for @timurcravtov/ts-ics
Gathering detailed insights and metrics for @timurcravtov/ts-ics
Gathering detailed insights and metrics for @timurcravtov/ts-ics
Parse and generate iCalendar with Typescript
npm install @timurcravtov/ts-ics
Typescript
Module System
Node Version
NPM Version
73.3
Supply Chain
98.9
Quality
82.1
Maintenance
100
Vulnerability
100
License
TypeScript (99.45%)
JavaScript (0.55%)
Total Downloads
411
Last Day
6
Last Week
20
Last Month
225
Last Year
411
NOASSERTION License
284 Commits
2 Branches
1 Contributors
Updated on Apr 26, 2025
Minified
Minified + Gzipped
Latest Version
2.1.4
Package Id
@timurcravtov/ts-ics@2.1.4
Unpacked Size
162.01 kB
Size
46.65 kB
File Count
8
NPM Version
10.9.2
Node Version
22.14.0
Published on
May 20, 2025
Cumulative downloads
Total Downloads
This library can parse and create Ics files and provides TypeScript types for easy handling and aims to be fully RFC 5545 compliant.
Fork of ts-ics
library
1npm install @timurcravtov/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});
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.
Last Day
-25%
6
Compared to previous day
Last Week
-85.2%
20
Compared to previous week
Last Month
21%
225
Compared to previous month
Last Year
0%
411
Compared to previous year