IMPORTANT: This is an early stage release and project structure can change greatly!
Parser and builder for iCalendar data format
npm instal ikalendar
import { Builder, Calendar } from 'ikalendar'
const calendar: Calendar = {
version: '2.0',
prodId: 'Awesome project prodId',
events: [
{
start: '20101231T083000Z',
uid: '[email protected]'
}
]
}
const builder = new Builder(calendar)
builder.build()
// Returns:
//
// BEGIN:VCALENDAR
// VERSION:2.0
// PRODID:Awesome project prodId
// BEGIN:VEVENT
// DTSTAMP:20101231T083000Z
// UID:[email protected]
// END:VEVENT
// END:VCALENDAR
import { Parser } from 'ikalendar'
const str = `BEGIN:VCALENDAR
VERSION:2.0
PRODID:Awesome project prodId
BEGIN:VEVENT
DTSTAMP:20101231T083000Z
UID:[email protected]
END:VEVENT
END:VCALENDAR
`
const parser = new Parser(str)
parser.parse()
// Returns:
//
// {
// version: '2.0',
// prodId: 'Awesome project prodId',
// events: [
// {
// start: '20101231T083000Z',
// uid: '[email protected]'
// }
// ]
// }
This project is licensed under the ISC License - see the LICENSE.md file for details