npm.io
7.0.3 • Published 1 week ago

@hebcal/icalendar

Licence
BSD-2-Clause
Version
7.0.3
Deps
4
Size
23 kB
Vulns
0
Weekly
0
Stars
1

@hebcal/icalendar

Jewish holidays and Hebrew calendar as iCalendar RFC 2445

Installation

$ npm install @hebcal/icalendar

Synopsis

import {HebrewCalendar, Location} from '@hebcal/core';
import {eventsToIcalendar} from '@hebcal/icalendar';
import fs from 'fs';

const options = {
  year: 2020,
  month: 2,
  sedrot: true,
  candlelighting: true,
  location: Location.lookup('Tel Aviv'),
};
const events = HebrewCalendar.calendar(options);

const str = await eventsToIcalendar(events, {
  locale: 'he',
  ...options,
});

const icalStream = fs.createWriteStream('feed.ics');
icalStream.write(str);
icalStream.close();

API Documentation

Keywords