the any family

Eight tools, zero dependencies — because the dependency is your browser. One function each, any locale.

anywhendates & times: Dates and times the way your reader expects them: written out, shortened, or just 3 hours ago.

anywhen

Dates and times the way your reader expects them: written out, shortened, or just 3 hours ago.

dates & timesv2.0.1
datesdatetimeformatrelative

you call

anywhen("2026-07-11T11:50", { mode: "relative" })

you get

 

anyamountmoney & numbers: Prices, quantities and units written the way each locale writes them. One call, any currency.

anyamount

Prices, quantities and units written the way each locale writes them. One call, any currency.

money & numbersv2.0.1
currencynumberformatunits

you call

anyamount(1234567)

you get

 

anymanylists: An array into a sentence — sorted and joined the way the locale does it, not the way English does.

anymany

An array into a sentence — sorted and joined the way the locale does it, not the way English does.

listsv2.0.1
listslistformatsort

you call

anymany(["a", "b", "c"])

you get

 

anyaroundnames & flags: Country, language, script and currency codes into the names people actually read, flag included.

anyaround

Country, language, script and currency codes into the names people actually read, flag included.

names & flagsv2.0.1
flagsdisplaynamesssr

you call

anyaround("US")

you get

 

anylongdurations: Durations that read like language: two hours thirty, from whatever shape you already have.

anylong

Durations that read like language: two hours thirty, from whatever shape you already have.

durationsv2.0.1
durationdurationformatelapsed

you call

anylong(9_000_000)

you get

 

anypluralplurals: One item or five, first or twenty-first — the right wording every time, even where there are six forms.

anyplural

One item or five, first or twenty-first — the right wording every time, even where there are six forms.

pluralsv2.0.1
pluralspluralrulesordinal

you call

anyplural(1, { one: "item", other: "items" })

you get

 

anywordwords & graphemes: Words, characters and sentences counted the way people see them, emoji and spaceless scripts included.

anyword

Words, characters and sentences counted the way people see them, emoji and spaceless scripts included.

words & graphemesv2.0.1
segmentergraphemetruncate

you call

anyword("don't stop 世界")

you get

 

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

anylocale

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

locale behaviourv1.0.1
rtlweek-startlocale-info

you call

anylocale("ar-EG").direction

you get

 

anyfamily — all eight any* packages in one install: anywhen, anyamount, anymany, anyaround, anylong, anyplural, anyword and anylocale behind a single import.

anyfamily

The whole family in one install — every formatter behind a single import, nothing unused shipped.

all at oncev2.1.1

you call

import { anywhen } from "anyfamily"; anywhen("2026-07-08", { mode: "relative" })

you get

 

anyfamily-react — React hooks for the any* family: useAnywhen, useAnyamount, useAnymany, useAnyaround, useAnylong, useAnyplural and useAnyword, sharing one locale provider.

anyreact

Every formatter as a hook, one locale for the whole app, and relative time that stays fresh.

hooks for the familyv2.1.1

you call

useAnywhen(date, { mode: "relative" })

you get