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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@krizaka/time

v0.2.0

Published

Date arithmetic for every Krizaka backend, in one place: add seconds, minutes and hours to an instant, measure the gap between two, compare them. Exact on the instant, whatever the server's time zone. The facade the « Krizaka first » dates rule points to,

Readme

@krizaka/time

Date arithmetic for every Krizaka backend, in one place. The « Krizaka first » dates rule (@krizaka/config) refuses a date library inside a package; this is the facade it points to, so addSeconds, addHours, differenceInSeconds and isBefore are written once and the library behind them can change without touching a package.

import { addSeconds, differenceInSeconds, isBefore } from "@krizaka/time";

const resetAt = addSeconds(clock.now(), 900);
if (isBefore(resetAt, clock.now())) { /* ended */ }
const retryAfter = differenceInSeconds(resetAt, clock.now());
  • Exact on the instant. Adding two hours adds 7 200 000 ms whatever the server's time zone, so « a session of 14 days » is addHours(now, 14 * 24) and lasts the same on every server, across a daylight-saving change.
  • Not the calendar. The day a law, a deadline or a receipt means, in a person's zone, is not arithmetic on an instant: use localDay of @krizaka/intl. For that reason there is no addDays here.
  • Missing function? Add it here first (with its test), never import the library beside it.
  • Pure: no clock of its own (take a Clock from @krizaka/db), no environment, no I/O.

Validation shapes

isIsoDate (YYYY-MM-DD), isEmail, isHttpUrl, isSlug, isE164Phone, isCanadianPostalCode: type guards on unknown, pure, no I/O. The no-hand-written-validation-regex rule of @krizaka/config refuses a hand-written pattern for these shapes and points here. An email check says the shape is right, never that the mailbox exists. Missing a fact? Add it here first, with its test.