@hebcal/leyning
TypeScript icon, indicating that this package has built-in type declarations

9.1.0 • Public • Published

@hebcal/leyning

Javascript Torah Reading API for Parashat HaShavua and holidays

Build Status

This package includes both traditional (full kriyah) and weekday Torah readings.

Triennial Torah Readings have moved to @hebcal/triennial

Installation

$ npm install @hebcal/leyning

Synopsis

import {HebrewCalendar, HDate, Event} from '@hebcal/core';
import {getLeyningForParshaHaShavua, formatAliyahWithBook} from '@hebcal/leyning';

const events = HebrewCalendar.calendar({sedrot: true, noHolidays: true});
const ev = events.find((ev) => ev.getDesc() == 'Parashat Pinchas');
const reading = getLeyningForParshaHaShavua(ev, false);
console.log(`${ev.getDesc()}: ${reading.summary}`);
console.log(`Haftara: ${reading.haftara}`);
for (const [num, aliyah] of Object.entries(reading.fullkriyah)) {
  const number = num == 'M' ? 'maftir' : `aliyah ${num}`;
  let str = formatAliyahWithBook(aliyah);
  if (aliyah.reason) {
      str += ' | ' + aliyah.reason;
  }
  str += ` (${aliyah.v} verses)`;
  console.log(`${number}: ${str}`);
}

Package Sidebar

Install

npm i @hebcal/leyning

Weekly Downloads

174

Version

9.1.0

License

BSD-2-Clause

Unpacked Size

318 kB

Total Files

37

Last publish

Collaborators

  • mjradwin