Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@hebcal/core
Advanced tools
Hebcal is a perpetual Jewish Calendar. This library converts between Hebrew and Gregorian dates, and generates lists of Jewish holidays for any year (past, present or future). Shabbat and holiday candle lighting and havdalah times are approximated based on location. Torah readings (Parashat HaShavua), Daf Yomi, and counting of the Omer can also be specified. Hebcal also includes algorithms to calculate yahrzeits, birthdays and anniversaries.
Hebcal was created in 1994 by Danny Sadinoff as a Unix/Linux program
written in C, inspired by similar functionality written in Emacs
Lisp. The initial JavaScript port was released in 2014 by Eyal
Schachter (age 15). This ECMAScript 2015 implementation was released
in 2020 by Michael J. Radwin. @hebcal/core
targets both
browser-based JavaScript and server-side Node.js.
Many users of this library will utilize the HebrewCalendar and HDate interfaces.
npm install @hebcal/core
This package exports 3 categories of output:
dist/bundle.min.js
: This includes all dependencies in a single JS file. It's quite large (174KB minified), and should only be used if you aren't using a bundler.dist/index.cjs
: This includes all of this package's code in a single bundle.dist/es/
: This directory contains ES modules for each source file in the package. If you're using Rollup, Vite, or another bundler, you should import from here to reduce output sizes.
These files do not include polyfills; if you want to support older browsers, use https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
To make tree-shaking work better, import from the most specific file possible; avoid importing from index
or hebcal
. Some APIs may still need to be moved to specific files. For example:
import {getHolidaysOnDate} from '@hebcal/core/dist/es/holidays';
This can save hundreds of kilobytes by dropping Zmanim dependencies if your code doesn't use them.
You will need to include @rollup/plugin-node-resolve
in your Rollup config.
import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
const options: CalOptions = {
year: 1981,
isHebrewYear: false,
candlelighting: true,
location: Location.lookup('San Francisco'),
sedrot: true,
omer: true,
};
const events = HebrewCalendar.calendar(options);
for (const ev of events) {
const hd = ev.getDate();
const date = hd.greg();
console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());
}
FAQs
A perpetual Jewish Calendar API
The npm package @hebcal/core receives a total of 2,612 weekly downloads. As such, @hebcal/core popularity was classified as popular.
We found that @hebcal/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.