anylocalelocale behaviour: How a locale behaves: which way text runs, when the week starts, which days are the weekend.

anylocale
about anylocale

Reads how a locale behaves — text direction, first day of the week, weekend days, calendars, time zones, hour cycle, numbering systems — as one record.

wraps
Intl.Locale info (getWeekInfo, getTextInfo, getCalendars, …)
install
npm install anylocale
runtime
Node 18+ (property form) or any engine with the method form — branch on anylocale.supported.
docs
anyfamily.site/docs/anylocale
playground
run the family on StackBlitz

why

Hand-kept RTL lists, week-start tables and weekend rules go stale and miss cases like fa-IR's one-day weekend. The runtime knows; anylocale exposes it as one cached record, resolves fallback chains on real data, and works across the property and method forms engines ship.

usage

anylocale("ar-EG").direction         // "rtl"
anylocale("en-GB").weekStart         // 1 — Monday; en-US is 7 (ISO numbering)
anylocale("fa-IR").weekend           // [5] — Friday only
anylocale("ar-EG").timeZones         // ["Africa/Cairo"]
anylocale(["xx-Nope", "de-DE"]).tag  // "de-DE" — first tag with data wins
anylocale.supported                  // Intl Locale Info present?

not for

Naming a locale (that is anyaround), translating anything, or detecting the user's locale.