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

5.0.8 • Public • Published

hebcal-learning

Javascript Daily Learning Schedules

Build Status

Supports several learning schedules

  • Daf Yomi (Babylonian Talmud / Bavli) - dafYomi
  • Mishna Yomi - mishnaYomi
  • Nach Yomi - nachYomi
  • Tanakh Yomi - tanakhYomi
  • Psalms / Tehillim (30 day cycle) - psalms
  • Yerushalmi Yomi (Jerusalem Talmud)
    • Vilna edition - yerushalmi-vilna
    • Schottenstein edition - yerushalmi-schottenstein
  • Daily Rambam (Mishneh Torah)
    • 1 chapter a day cycle - rambam1
  • Chofetz Chaim - chofetzChaim
  • Sefer Shemirat HaLashon - shemiratHaLashon
  • Daf-a-Week
    • Daily - dafWeekly
    • Sundays only - dafWeeklySunday
  • Pirkei Avot studied on Shabbat between Pesach and Rosh Hashana - pirkeiAvotSummer

Installation

$ npm install @hebcal/learning

Synopsis

import {HDate, DailyLearning} from '@hebcal/core';
import '@hebcal/learning';

const dt = new Date();
const hd = new HDate(dt);
const ev = DailyLearning.lookup('dafYomi', hd);
console.log(dt.toLocaleDateString(), hd.toString(), ev.render('en'));

Classes

DafPage

Represents a tractate and page number

DafPageEvent

Event wrapper around a DafPage instance

DafYomi

Returns the Daf Yomi for given date

DafYomiEvent

Event wrapper around a DafYomi instance

MishnaYomiEvent

Event wrapper around a Mishna Yomi instance

MishnaYomiIndex

A program of daily learning in which participants study two Mishnahs each day in order to finish the entire Mishnah in ~6 years.

NachYomiEvent

Event wrapper around a Nach Yomi instance

NachYomiIndex

A daily regimen of learning the books of Nevi'im (Prophets) and Ketuvim (Writings).

YerushalmiYomiEvent

Event wrapper around a Yerushalmi Yomi result

ChofetzChaimEvent

Event wrapper around a Chofetz Chaim instance

DailyRambamEvent

Event wrapper around a Daily Rambam instance

ShemiratHaLashonEvent

Event wrapper around a Sefer Shemirat HaLashon instance

PsalmsEvent

Event wrapper around a daily Psalms / Tehillim

DafWeeklyEvent

Event wrapper around a daily weekly

TanakhYomi

Returns the Daf Yomi for given date

TanakhYomiEvent

Event wrapper around a tanakhYomi

PirkeiAvotSummerEvent

Event wrapper for Pirkei Avot being studied on Shabbat between Pesach and Rosh Hashana

Constants

vilna

Yerushalmi Yomi configuration for Vilna Edition

schottenstein

Yerushalmi Yomi configuration for Schottenstein Edition

Functions

yerushalmiYomi(date, config)any

Using the Vilna edition, the Yerushalmi Daf Yomi program takes ~4.25 years or 51 months. Unlike the Daf Yomi Bavli cycle, this Yerushalmi cycle skips both Yom Kippur and Tisha B'Av (returning null). The page numbers are according to the Vilna Edition which is used since 1900.

The Schottenstein edition uses different page numbers and takes ~6 years to complete.

Throws an exception if the date is before Daf Yomi Yerushalmi cycle began (2 February 1980 for Vilna, 14 November 2022 for Schottenstein).

chofetzChaim(hdate)any

Looks up Chofetz Chaim Calendar for date

dailyRambam1(date)any

Calculates Daily Rambam (Mishneh Torah) for 1 chapter a day cycle.

shemiratHaLashon(hdate)any

Looks up Sefer Shemirat HaLashon Calendar for date

dailyPsalms(date)any

Calculates Daily Psalms (Tehillim) for 30-day cycle.

dafWeekly(date)DafPage

Daf-a-Week

tanakhYomi(date)TanakhYomi

Calculates Tanakh Yomi.

pirkeiAvot(dt, il)Array.<number>

Pirkei Avot being studied on Shabbat between Pesach and Rosh Hashana

"From at least the time of Saadia Gaon (10th century), it has been customary to study one chapter a week on each Shabbat between Passover and Shavuot; today, the tractate is generally studied on each Shabbat of the summer, from Passover to Rosh Hashanah, the entire cycle repeating a few times with doubling of chapters at the end if there are not a perfect multiple of six weeks" https://en.wikipedia.org/wiki/Pirkei_Avot#Study_of_the_work

returns array (since it can return 2 chapters) or undefined if there is no Pirkei Avot on that day optimized for diaspora and il feel free to modify whatever you want, i am sure this task can be done in different ways and orders

Typedefs

MishnaYomi : Object

Describes a mishna to be read

NachYomi : Object

Describes a chapter to be read

DafPage

Represents a tractate and page number

Kind: global class

new DafPage(name, blatt)

Initializes a daf yomi instance

Param Type
name string
blatt number

dafPage.getBlatt() ⇒ number

Kind: instance method of DafPage

dafPage.getName() ⇒ string

Kind: instance method of DafPage

dafPage.render([locale]) ⇒ string

Formats (with translation) the dafyomi result as a string like "Pesachim 34"

Kind: instance method of DafPage

Param Type Description
[locale] string Optional locale name (defaults to active locale).

DafPageEvent

Event wrapper around a DafPage instance

Kind: global class

new DafPageEvent(date, daf, mask)

Param Type
date HDate
daf DafPage
mask number

dafPageEvent.render([locale]) ⇒ string

Returns Daf Yomi name including the 'Daf Yomi: ' prefix (e.g. "Daf Yomi: Pesachim 107").

Kind: instance method of DafPageEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

dafPageEvent.renderBrief([locale]) ⇒ string

Returns Daf Yomi name without the 'Daf Yomi: ' prefix (e.g. "Pesachim 107").

Kind: instance method of DafPageEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

dafPageEvent.url() ⇒ string

Returns a link to sefaria.org or dafyomi.org

Kind: instance method of DafPageEvent

DafYomi

Returns the Daf Yomi for given date

Kind: global class

new DafYomi(date)

Initializes a daf yomi instance

Param Type Description
date Date | HDate | number Gregorian or Hebrew date

DafYomiEvent

Event wrapper around a DafYomi instance

Kind: global class

new DafYomiEvent(date)

Param Type
date HDate

dafYomiEvent.render([locale]) ⇒ string

Returns Daf Yomi name including the 'Daf Yomi: ' prefix (e.g. "Daf Yomi: Pesachim 107").

Kind: instance method of DafYomiEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

dafYomiEvent.getCategories() ⇒ Array.<string>

Kind: instance method of DafYomiEvent

MishnaYomiEvent

Event wrapper around a Mishna Yomi instance

Kind: global class

new MishnaYomiEvent(date, mishnaYomi)

Param Type
date HDate
mishnaYomi Array.<MishnaYomi>

mishnaYomiEvent.render([locale]) ⇒ string

Returns Mishna Yomi name (e.g. "Bava Metzia 10:5-6" or "Berakhot 9:5-Peah 1:1").

Kind: instance method of MishnaYomiEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

mishnaYomiEvent.url() ⇒ string

Returns a link to sefaria.org

Kind: instance method of MishnaYomiEvent

mishnaYomiEvent.getCategories() ⇒ Array.<string>

Kind: instance method of MishnaYomiEvent

MishnaYomiIndex

A program of daily learning in which participants study two Mishnahs each day in order to finish the entire Mishnah in ~6 years.

Kind: global class

new MishnaYomiIndex()

Initializes a Mishna Yomi instance

mishnaYomiIndex.days : Array.<MishnaYomi>

Kind: instance property of MishnaYomiIndex

mishnaYomiIndex.lookup(date) ⇒ Array.<MishnaYomi>

Looks up a Mishna Yomi

Kind: instance method of MishnaYomiIndex

Param Type Description
date Date | HDate | number Gregorian date

NachYomiEvent

Event wrapper around a Nach Yomi instance

Kind: global class

new NachYomiEvent(date, nachYomi)

Param Type
date HDate
nachYomi NachYomi

nachYomiEvent.render([locale]) ⇒ string

Returns name of tractate and page (e.g. "Beitzah 21").

Kind: instance method of NachYomiEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

nachYomiEvent.url() ⇒ string

Returns a link to sefaria.org

Kind: instance method of NachYomiEvent

nachYomiEvent.getCategories() ⇒ Array.<string>

Kind: instance method of NachYomiEvent

NachYomiIndex

A daily regimen of learning the books of Nevi'im (Prophets) and Ketuvim (Writings).

Kind: global class

new NachYomiIndex()

Initializes a Nach Yomi instance

nachYomiIndex.lookup(date) ⇒ NachYomi

Looks up a Mishna Yomi

Kind: instance method of NachYomiIndex

Param Type Description
date Date | HDate | number Gregorian date

YerushalmiYomiEvent

Event wrapper around a Yerushalmi Yomi result

Kind: global class

new YerushalmiYomiEvent(date, daf)

Param Type
date HDate
daf any

yerushalmiYomiEvent.render([locale]) ⇒ string

Returns name of tractate and page (e.g. "Yerushalmi Beitzah 21").

Kind: instance method of YerushalmiYomiEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

yerushalmiYomiEvent.renderBrief([locale]) ⇒ string

Returns name of tractate and page (e.g. "Beitzah 21").

Kind: instance method of YerushalmiYomiEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

yerushalmiYomiEvent.url() ⇒ string

Returns a link to sefaria.org

Kind: instance method of YerushalmiYomiEvent

yerushalmiYomiEvent.getCategories() ⇒ Array.<string>

Kind: instance method of YerushalmiYomiEvent

ChofetzChaimEvent

Event wrapper around a Chofetz Chaim instance

Kind: global class

new ChofetzChaimEvent(date, reading)

Param Type
date HDate
reading any

chofetzChaimEvent.renderBrief([locale]) ⇒ string

Returns name of reading

Kind: instance method of ChofetzChaimEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

chofetzChaimEvent.render([locale]) ⇒ string

Returns name of reading

Kind: instance method of ChofetzChaimEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

chofetzChaimEvent.url() ⇒ string

Returns a link to sefaria.org e.g. https://www.sefaria.org/Chofetz_Chaim%2C_Part_One%2C_The_Prohibition_Against_Lashon_Hara%2C_Principle_7.7

Kind: instance method of ChofetzChaimEvent

chofetzChaimEvent.getCategories() ⇒ Array.<string>

Kind: instance method of ChofetzChaimEvent

DailyRambamEvent

Event wrapper around a Daily Rambam instance

Kind: global class

new DailyRambamEvent(date, reading)

Param Type
date HDate
reading any

dailyRambamEvent.render([locale]) ⇒ string

Returns name of reading

Kind: instance method of DailyRambamEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

dailyRambamEvent.url() ⇒ string

Returns a link to sefaria.org

Kind: instance method of DailyRambamEvent

dailyRambamEvent.getCategories() ⇒ Array.<string>

Kind: instance method of DailyRambamEvent

ShemiratHaLashonEvent

Event wrapper around a Sefer Shemirat HaLashon instance

Kind: global class

new ShemiratHaLashonEvent(date, reading)

Param Type
date HDate
reading any

shemiratHaLashonEvent.render([locale]) ⇒ string

Returns name of reading

Kind: instance method of ShemiratHaLashonEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

shemiratHaLashonEvent.url() ⇒ string

Returns a link to sefaria.org e.g. https://www.sefaria.org/Shemirat_HaLashon%2C_Book_I%2C_The_Gate_of_Torah.4.2?lang=b

Kind: instance method of ShemiratHaLashonEvent

shemiratHaLashonEvent.getCategories() ⇒ Array.<string>

Kind: instance method of ShemiratHaLashonEvent

PsalmsEvent

Event wrapper around a daily Psalms / Tehillim

Kind: global class

new PsalmsEvent(date, reading)

Param Type
date HDate
reading Array.<number> | Array.<string>

psalmsEvent.render([locale]) ⇒ string

Returns name of reading

Kind: instance method of PsalmsEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

psalmsEvent.url() ⇒ string

Returns a link to sefaria.org e.g. https://www.sefaria.org/Psalms.1-9?lang=b

Kind: instance method of PsalmsEvent

psalmsEvent.getCategories() ⇒ Array.<string>

Kind: instance method of PsalmsEvent

DafWeeklyEvent

Event wrapper around a daily weekly

Kind: global class

new DafWeeklyEvent(date, daf)

Param Type
date HDate
daf DafPage

dafWeeklyEvent.getCategories() ⇒ Array.<string>

Kind: instance method of DafWeeklyEvent

TanakhYomi

Returns the Daf Yomi for given date

Kind: global class

new TanakhYomi(name, blatt)

Initializes a daf yomi instance

Param Type
name string
blatt number

tanakhYomi.render([locale]) ⇒ string

Formats (with translation) the dafyomi result as a string like "Pesachim 34"

Kind: instance method of TanakhYomi

Param Type Description
[locale] string Optional locale name (defaults to active locale).

TanakhYomiEvent

Event wrapper around a tanakhYomi

Kind: global class

new TanakhYomiEvent(date, daf)

Param Type
date HDate
daf TanakhYomi

tanakhYomiEvent.url() ⇒ string

Returns a link to sefaria.org or dafyomi.org

Kind: instance method of TanakhYomiEvent

tanakhYomiEvent.getCategories() ⇒ Array.<string>

Kind: instance method of TanakhYomiEvent

PirkeiAvotSummerEvent

Event wrapper for Pirkei Avot being studied on Shabbat between Pesach and Rosh Hashana

Kind: global class

new PirkeiAvotSummerEvent(date, reading)

Param Type
date HDate
reading Array.<number>

pirkeiAvotSummerEvent.render([locale]) ⇒ string

Returns name of reading

Kind: instance method of PirkeiAvotSummerEvent

Param Type Description
[locale] string Optional locale name (defaults to active locale).

pirkeiAvotSummerEvent.url() ⇒ string

Returns a link to sefaria.org

Kind: instance method of PirkeiAvotSummerEvent

pirkeiAvotSummerEvent.getCategories() ⇒ Array.<string>

Kind: instance method of PirkeiAvotSummerEvent

vilna

Yerushalmi Yomi configuration for Vilna Edition

Kind: global constant
Read only: true

schottenstein

Yerushalmi Yomi configuration for Schottenstein Edition

Kind: global constant
Read only: true

yerushalmiYomi(date, config) ⇒ any

Using the Vilna edition, the Yerushalmi Daf Yomi program takes ~4.25 years or 51 months. Unlike the Daf Yomi Bavli cycle, this Yerushalmi cycle skips both Yom Kippur and Tisha B'Av (returning null). The page numbers are according to the Vilna Edition which is used since 1900.

The Schottenstein edition uses different page numbers and takes ~6 years to complete.

Throws an exception if the date is before Daf Yomi Yerushalmi cycle began (2 February 1980 for Vilna, 14 November 2022 for Schottenstein).

Kind: global function

Param Type Description
date HDate | Date | number Hebrew or Gregorian date
config any either vilna or schottenstein

chofetzChaim(hdate) ⇒ any

Looks up Chofetz Chaim Calendar for date

Kind: global function

Param Type
hdate HDate

dailyRambam1(date) ⇒ any

Calculates Daily Rambam (Mishneh Torah) for 1 chapter a day cycle.

Kind: global function

Param Type Description
date HDate | Date | number Hebrew or Gregorian date

shemiratHaLashon(hdate) ⇒ any

Looks up Sefer Shemirat HaLashon Calendar for date

Kind: global function

Param Type
hdate HDate

dailyPsalms(date) ⇒ any

Calculates Daily Psalms (Tehillim) for 30-day cycle.

Kind: global function

Param Type Description
date HDate | Date | number Hebrew or Gregorian date

dafWeekly(date) ⇒ DafPage

Daf-a-Week

Kind: global function

Param Type Description
date HDate | Date | number Hebrew or Gregorian date

tanakhYomi(date) ⇒ TanakhYomi

Calculates Tanakh Yomi.

Kind: global function

Param Type Description
date HDate | Date | number Hebrew or Gregorian date

pirkeiAvot(dt, il) ⇒ Array.<number>

Pirkei Avot being studied on Shabbat between Pesach and Rosh Hashana

"From at least the time of Saadia Gaon (10th century), it has been customary to study one chapter a week on each Shabbat between Passover and Shavuot; today, the tractate is generally studied on each Shabbat of the summer, from Passover to Rosh Hashanah, the entire cycle repeating a few times with doubling of chapters at the end if there are not a perfect multiple of six weeks" https://en.wikipedia.org/wiki/Pirkei_Avot#Study_of_the_work

returns array (since it can return 2 chapters) or undefined if there is no Pirkei Avot on that day optimized for diaspora and il feel free to modify whatever you want, i am sure this task can be done in different ways and orders

Kind: global function

Param Type
dt Date | HDate
il boolean

MishnaYomi : Object

Describes a mishna to be read

Kind: global typedef
Properties

Name Type Description
k string tractate name in Sephardic transliteration (e.g. "Berakhot", "Moed Katan")
v string verse (e.g. "2:1")

NachYomi : Object

Describes a chapter to be read

Kind: global typedef
Properties

Name Type Description
k string book name in Sephardic transliteration (e.g. "Berakhot", "Moed Katan")
v number chapter (e.g. "2:1")

Readme

Keywords

none

Package Sidebar

Install

npm i @hebcal/learning

Weekly Downloads

81

Version

5.0.8

License

BSD-2-Clause

Unpacked Size

533 kB

Total Files

8

Last publish

Collaborators

  • mjradwin