https://github.com/jack-weilage/chronosis
An extremely lightweight, modern date management library
https://github.com/jack-weilage/chronosis
date datetime javascript typescript
Last synced: 21 days ago
JSON representation
An extremely lightweight, modern date management library
- Host: GitHub
- URL: https://github.com/jack-weilage/chronosis
- Owner: jack-weilage
- License: mit
- Created: 2023-09-08T01:34:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-24T00:52:05.000Z (over 1 year ago)
- Last Synced: 2025-06-29T09:02:01.544Z (7 months ago)
- Topics: date, datetime, javascript, typescript
- Language: TypeScript
- Homepage: https://chronosis.js.org/
- Size: 2.72 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/chronosis)
[](https://bundlephobia.com/package/chronosis)
> [!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](https://github.com/date-fns/date-fns)'s `add` function. That's ~3x smaller than [dayjs](https://github.com/iamkun/dayjs) and ~22x smaller than [luxon](https://github.com/moment/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.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) to translate language-specific terms via the browser.
## Installation
To install, use your preferred package manager to download `chronosis`.
```bash
npm install chronosis
```
For contributors
`chronosis` is developed on Linux, using [bun.sh](https://github.com/oven-sh/bun) 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](https://learn.microsoft.com/en-us/windows/wsl/install) and continue from there.
Once complete, just import the `Chronosis` class into your code, and start programming!
## Usage
Manipulating dates and times should be simple, so `Chronosis` makes it easy.
```ts
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](https://chronosis.js.org).
## Examples
### Find how many days are left in the month
```ts
const now = new Chronosis()
const end_of_month = now.endOf('month')
const days_left = end_of_month.get('day') - now.get('day')
```
## Contributing
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) to see how best to contribute to this project.