Warning
Chronosis is currently in BETA. Expect frequent breaking changes as the API and codebase matures.
The fastest and smallest date manipulation library.
- Tiny: Gzips to less than 1 kilobyte, comparable to the size of only date-fns's
addfunction. That's ~3x smaller than dayjs and ~22x smaller than luxon! - Simple: Only includes necessary functions for manipulation and formatting, excluding excess like equality comparisons.
- Absurdly fast: Significantly faster at nearly every single common action than any other similar package.
- I18N: Implements
Intl.DateTimeFormatto translate language-specific terms via the browser.
To install, use your preferred package manager to download chronosis.
npm install chronosisFor contributors
chronosis is developed on Linux, using bun.sh as package manager, script runner, bundler, and test runner. Certain parts of the project may work on Windows, but it is highly suggested to install WSL and continue from there.
Once complete, just import the Chronosis class into your code, and start programming!
Manipulating dates and times should be simple, so Chronosis makes it easy.
import { Chronosis } from 'chronosis'
const now = new Chronosis()
// Familiar, chainable syntax
const noon_tomorrow = now.add(1, 'day').set('hour', 11).startOf('hour')
// Intuitive, internationalized formatting
console.log(noon_tomorrow.format('dddd, MMMM D, YYYY', 'es-MX'))
// Logs something like 'sábado, septiembre 9, 2023'For more detailed information and documentation, see chronosis.js.org.
const now = new Chronosis()
const end_of_month = now.endOf('month')
const days_left = end_of_month.get('day') - now.get('day')Please see CONTRIBUTING.md to see how best to contribute to this project.

