Installation
npm
npm install rosetta-dateRequirements
- Node ≥ 22.
- An ESM project.
importthe package — it ships as ESM only and cannot berequire()d.
rosetta-date has zero runtime dependencies and is fully tree-shakeable. The conversion API
lives at the package root, while dialects and libraries are imported from their own entrypoints —
so a build only pulls in the ecosystems you actually reference.
Entrypoints
| Import | What it provides |
|---|---|
rosetta-date | convert, createConverter, defineDialect, defineLibrary, Canonical, error and option types |
rosetta-date/dialects | Built-in dialects (moment, ldml) and getDialect |
rosetta-date/libraries | Built-in libraries (momentjs, dayjs, dateFns) and getLibrary |
Continue to the Quick start to make your first conversion.
Last updated on