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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@checkdigit/time

v5.0.0

Published

Standard time handling

Readme

Check Digit Time Library

Copyright (c) 2022-2025 Check Digit, LLC

The Check Digit time library is the officially sanctioned method for Check Digit services to deal with time. It has date manipulation functions provided by date-fns. Features:

  • Stripped down date-fns functions
  • date-fns-tz for timezone support
  • formatUtc for formatting UTC dates

The date-fns library is included. The only locale currently supported is en-US, but otherwise contains all available functionality as of v4.1.0 except that the code in fp folder are excluded, which contain functional programming related stuff that is not used at the moment.

Additionally, the date-fns-tz library is included. Contains all available functionality as of v3.2.0 except that the code in fp folder are excluded, which contain functional programming related stuff that is not used at the moment.

formatUtc

The formatUtc function is a wrapper around date-fns-tz's format function, but with the following differences:

  • There is no options argument, timeZone is always UTC.

Generally speaking, formatUtc should be used in place of format or tzFormat, unless non-UTC time zones are required.

Installing and usage

npm install @checkdigit/time then:

For date-fns functionality:

import { formatUtc } from '@checkdigit/time';

console.log(formatUtc(new Date(), 'yyyy-MM-dd'));

Documentation

The documentation for date-fns is here: https://date-fns.org/

The documentation for date-fns-tz is here: https://github.com/marnusw/date-fns-tz

Migration guide

following are the main steps to sync up with the latest date-fns/date-fns-tz

  • clone 3rd party repo
  • remove test/fp stuff
  • copy/override into @checkdigit/time repo's corresponding folder
  • update CHANGELOG.md (it helps to understand the changes since the last update and to prepare accordingly)
  • replace imports from '.js' to '.ts'
  • Add comments in the beginning of the files to silence ts/lint errors if it forces overwhelming changes otherwise
  • check things which compiles but may have other issues, e.g. import { type ZZZ } => import type { ZZZ }
  • adjust tsconfig.json compilerOptions if necessary
  • apply previous patch (e.g. daylight saving timezone, etc.)
  • pass existing local tests
  • beta-test across dependent repos to make sure it still works

Critical maintenance notes (VERY IMPORTANT!!!):

When updating the latest code from the original repositories, except making all the necessary changes to make them fully typescript compatible, please remember to carry over the patches to overcome the following issues:

  • hours is incorrect when it's close to daylight saving timezone threshold

Please search for [PATCH:] in the existing codebase.