npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chronosis

v0.2.0

Published

An extremely lightweight, modern date management library

Downloads

3

Readme

Downloads per month npm package minimized gzipped size (select exports)

[!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 add function. 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.DateTimeFormat to translate language-specific terms via the browser.

Installation

To install, use your preferred package manager to download chronosis.

npm install chronosis

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!

Usage

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.

Examples

Find how many days are left in the month

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 to see how best to contribute to this project.