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

tickgow

v1.0.1

Published

Date comparison and human-readable time formatting.

Readme

Tickgow

Date comparison and human-readable time formatting.

Overview

Tickgow lets you compare two dates, giving you detailed calculated outputs on exactly how much time has passed.

  • Get both normalized and raw time differences between two dates.
  • Easily convert dates into relative strings like "5 months ago", "in 2 days", or "just now".
  • Work Node.js and the browser.

Installation & Usage

Installation

Browser

Include the script tag:

<script src="https://cdn.jsdelivr.net/gh/rezzvy/tickgow@2a4bd62/dist/tickgow.min.js"></script>

Node

Install via npm:

npm install tickgow
const Tickgow = require("tickgow");

Usage

Tickgow.compare("2020-01-01", "2026-01-01");
Tickgow.now(Date.now());

Examples

Human-Readable Time

// Assuming today is April 2026
const past = Tickgow.now("2026-04-01");
// "1 week ago"

const future = Tickgow.now("2028-01-01");
// "in 1 year"

const rightNow = Tickgow.now(Date.now());
// "just now"

Date Comparison

const comparison = Tickgow.compare("2020-01-01", "2026-01-01");
console.log(comparison.years); // 6
console.log(comparison.isFuture); // false
console.log(comparison.raw.days); // 2192

Custom Labels

[!NOTE]
Baru saja is Indonesian meaning "just now"

Tickgow.defaultLabels.now = "Baru saja";

const rightNow = Tickgow.now(Date.now());
// "Baru saja"

Documentation

API Reference

Tickgow.now(date)

Calculates the difference between the provided date and the current time (Date.now()), returning a human-readable string based on the largest unit of time passed.

| Parameter | Type                           | Description                                           | | :--------- | :----------------------------- | :---------------------------------------------------- | | date     | String | Number | Date | The target date to compare against the current time. |

Returns: String (e.g., "2 years ago", "in 5 minutes", "just now")

Tickgow.compare(date1, date2)

Compares two dates and returns a detailed object containing both normalized calendar units and raw total units.

| Parameter | Type                           | Description                     | | :-------- | :----------------------------- | :------------------------------- | | date1   | String | Number | Date | The first date for comparison.   | | date2   | String | Number | Date | The second date for comparison. |

Returns: Object

| Property       | Type       | Description                                               | | :------------- | :--------- | :-------------------------------------------------------- | | isFuture     | Boolean | true if date1 is further in the future than date2. | | years       | Number   | Normalized years difference.                             | | months       | Number   | Normalized months difference.                             | | days         | Number   | Normalized days difference.                               | | hours       | Number   | Normalized hours difference.                             | | minutes     | Number   | Normalized minutes difference.                           | | seconds     | Number   | Normalized seconds difference.                           | | raw         | Object   | Contains the raw total differences between the dates.     | | raw.ms       | Number   | Total difference in milliseconds.                         | | raw.seconds | Number   | Total difference in seconds.                             | | raw.minutes | Number   | Total difference in minutes.                             | | raw.hours   | Number   | Total difference in hours.                               | | raw.days     | Number   | Total difference in days.                                 | | raw.months   | Number   | Total difference in decimal months.                       | | raw.years   | Number   | Total difference in decimal years.                       |

Tickgow.defaultLabels

A static object containing the default vocabulary used by the now() method to format relative time strings. You can modify this object to customize the output or localize the strings into different languages.

Default Value:

Tickgow.defaultLabels = {
  year: { singular: "year", plural: "years", past: "ago", future: "in" },
  month: { singular: "month", plural: "months", past: "ago", future: "in" },
  day: { singular: "day", plural: "days", past: "ago", future: "in" },
  hour: { singular: "hour", plural: "hours", past: "ago", future: "in" },
  min: { singular: "minute", plural: "minutes", past: "ago", future: "in" },
  sec: { singular: "second", plural: "seconds", past: "ago", future: "in" },
  now: "just now",
};

Contributing

There's always room for improvement. Feel free to contribute!

Licensing

The project is licensed under the MIT License. Check the license file for more details.