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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@grahan/calendars

v1.0.1

Published

World calendars for the grahan sky engine, Bikram Sambat (Nepali) first: data-driven BS ↔ AD conversion and today-in-BS. Zero dependencies.

Readme

@grahan/calendars

World calendars for the grahan sky engine — Bikram Sambat (the Nepali civil calendar) first; Hijri, Hebrew, and Chinese lunisolar planned. Zero dependencies beyond @grahan/core.

npm install @grahan/calendars
import { bsFromDate, dateFromBs, todayBs } from '@grahan/calendars';

todayBs({ timezone: 'Asia/Kathmandu' });
// { year: 2083, month: 3, day: 21,
//   monthName: { roman: 'Asar', nepali: 'असार' },
//   weekday: { index: 0, name: 'Sunday', roman: 'Aaitabar', nepali: 'आइतबार' },
//   projected: false }

bsFromDate({ year: 1993, month: 8, day: 18 });
// { year: 2050, month: 5, day: 2, monthName: { roman: 'Bhadra', … }, … }

dateFromBs({ year: 2050, month: 5, day: 2 });
// { year: 1993, month: 8, day: 18, weekday: { … name: 'Wednesday' … } }

Conversion works on plain calendar dates ({ year, month, day }) — a BS↔AD mapping is date arithmetic, so no timezone is involved anywhere except todayBs, which needs one to know what "today" means.

Where the data comes from

Bikram Sambat months are solar — each begins at a sankranti, the sun's ingress into the next sidereal sign — but the official calendar is fixed annually by Nepal's calendar authority, so tables beat formulas:

  • BS 1975–2083 (verified): month lengths cross-validated between two independently maintained datasets, with anchor dates (including the ambiguous 2062 Baisakh) verified against the published hamropatro.com calendar and documented historical events. See fixtures/bs-anchors.json.
  • BS 2084–2200 (projected): sankranti instants computed from the textbook Surya Siddhanta sun — the classical model the committee follows — mapped to Kathmandu civil days by a boundary rule fitted on the 109 verified years (99.77% of month starts exact; the fitted cutoffs sit near sunrise, the traditional Hindu day boundary, with the solstice sankrantis following their own punya-kala conventions). Dates there carry projected: true: a month boundary may be ±1 day off the calendar the authority eventually publishes.

Range: 1918-04-13 through 2144-04-12 AD. Out-of-range and impossible dates throw RangeError.

API

| Function | Purpose | | ---------------------------- | ---------------------------------------------- | | bsFromDate(adDate) | Gregorian → BS, with names, weekday, flag | | dateFromBs(bsDate) | BS → Gregorian, validated against real lengths | | todayBs({ timezone }) | today's BS date in an IANA timezone | | BS_MONTH_NAMES | Baisakh…Chaitra in roman + Devanagari | | BS_WEEKDAY_NAMES | Sunday-first weekday names, roman + Devanagari | | BS_MIN_YEAR, BS_MAX_YEAR | table coverage (1975, 2200) | | BS_VERIFIED_THROUGH | last authority-published year (2083) |

MIT © Svarbhanu Neel