npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@orthodox-union/shnayimmikrah

v0.8.0

Published

Wrapper over Sefaria API in order to get Shnayim Mikrah texts.

Downloads

562

Readme

Shnayim Mikrah

This project serves as a wrapper over the Sefaria api to enable presenting Shnayim Mikrah text by Aliyah.

On-line Support

Request

The following arguments can be set to control what data is returned:

interface Args {
  /**
   * Used to determine what date we need to look at in order to return the correct Aliyah
   * Must be a valid IANA time zone string, such as Asia/Jerusalem, America/New_York, Europe/Paris, etc.
   */
  timezone: string;
  /**
   * Used to specify if you want the parasha according to the diaspora calendar or according to the Israel calendar. 
   * Default is diaspora=1 to get the diaspora version.
   */
  diaspora?: number;
  /**
   * Used to control what ALiyah is returned. Default is the Aliyah for the day of the week.
   */
  aliyah?: 1 | 2 | 3 | 4 | 5 | 6 | 7; 

	/**
	 * What version should be used for the Hebrew text
	 */
	hebrewTextVersion: HebrewTextVersionOptions;
	
	/**
	 * What version should be used for the English text
	 */
	englishTextVersion: EnglishTextVersionOptions;
}
import getShnayimMikrah from '@orthodox-union/shnayimmikrah';

// This will return the Shnayim Mikrah for todays aliyah as would be leined in the America/New_York timezone.
await getShnayimMikrah({
  timezone: 'America/New_York'
});

Response

The data returned will have the following shape:

interface Aliyah {
    book: 'Genesis' | 'Exodus' | 'Leviticus' | 'Numbers' | 'Deuteronomy';
    aliyah: 1 | 2 | 3 | 4 | 5 | 6 | 7;
    verseRange: string; // Genesis 30:14-30:27
    verses: Array<{
      book: 'Genesis' | 'Exodus' | 'Leviticus' | 'Numbers' | 'Deuteronomy';
      chapter: number;
      verse: number;
      hebrewText: string;
      englishText: string;
      targum: string;
      rashi: string[];
    }>;
}

Off-line Support

Download

To download the data, you have the following options

interface DownloadArgs {
	/**
	 * Should the entire Chumash be download.
	 * Will take predence over `book`
	 */
	all: boolean;
	/**
	 * The Book you want to download.
	 */
	book: BookName;
	/**
	 * How the data should be stored
	 * @param {data} data The data being saved
	 */
	save: (data: OfflineStorage) => void;
	/**
	 * What version should be used for the Hebrew text
	 */
	hebrewTextVersion: HebrewTextVersionOptions;
	
	/**
	 * What version should be used for the English text
	 */
	englishTextVersion: EnglishTextVersionOptions;
}

Request

interface OfflineArgs {
	/**
   * Tells the package how to get the data.
   */
  getData: (book: BookName) => Promise<OfflineStorage>;
  /**
   * The book the Parsha is in.
   * Used in the getData function
   */
  book: BookName;
	/**
   * The Parsha to return.
   */
	parsha: ParshaName;
	/**
   * Used to control what ALiyah is returned. Default is the Aliyah for the day of the week.
   */
	aliyah?: AliyahNumber;
	/**
   * If true, the entire Parsha of the week will be returned.
   */
	wholeParsha?: boolean;
}

Response

If you request a single Aliyah, the response will be the same as offline support.

Otherwise you will get the entire Parsha:

interface Parsha {
	name: ParshaName;
	book: BookName;
	fullRef: string;
	aliyot: Aliyah[];
}