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

@bemoje/date

v2.0.0

Published

Lightweight date and time utilities for formatting, time-unit conversion, and duration measurement.

Readme

@bemoje/date

Lightweight date and time utilities for formatting, time-unit conversion, and duration measurement.

TypeScript Module

Exports

  • Timer: Returns a function that returns the elapsed time since invokation.
  • dateString: Reutnrs the date formatted as: yyyy-MM-dd
  • daysToMs: Converts days to milliseconds.
  • getWeek: Get the week number of the year for a given date using Danish locale.
  • hasCooldownElapsed: Determines if a specified cooldown period has elapsed since a given date.
  • hoursToMs: Converts hours to milliseconds.
  • minutesToMs: Converts minutes to milliseconds.
  • monthNameDa: Returns the name, in Danish language, of the month corresponding to the provided month number.
  • monthNameDaRelative name of the month relative to the current month.
  • msSinceDate: Calculates the number of milliseconds that have elapsed since the given date.
  • secondsToMs: Converts seconds to milliseconds.
  • stripTime: Remove the time component from a date, returning only the date part.
  • today: Get the UTC date today, time stripped
  • yesterday: Get the UTC date yesterday, time stripped

Installation

npm install @bemoje/date

Usage

Date Formatting

import { dateString, today, yesterday } from '@bemoje/date'

dateString()
// => '2026-02-28'

dateString(new Date(2025, 0, 15))
// => '2025-01-15'

today()
// => Date object for today at 00:00:00

yesterday()
// => Date object for yesterday at 00:00:00

Time Unit Conversion

import { daysToMs, hoursToMs, minutesToMs, secondsToMs } from '@bemoje/date'

daysToMs(1) // => 86400000
hoursToMs(2) // => 7200000
minutesToMs(30) // => 1800000
secondsToMs(45) // => 45000

Duration & Cooldowns

import { msSinceDate, hasCooldownElapsed, Timer } from '@bemoje/date'

// Milliseconds elapsed since a date
const start = new Date('2026-02-01')
msSinceDate(start)
// => number of ms since Feb 1

// Check if a cooldown period has passed
hasCooldownElapsed(start, daysToMs(7))
// => true (if more than 7 days have passed)

// Stopwatch-style timer
const elapsed = Timer()
// ... do some work ...
elapsed()
// => '142ms' (human-readable duration string)

Week & Date Operations

import { getWeek, stripTime } from '@bemoje/date'

getWeek(new Date('2026-02-28'))
// => 9

// Remove time component from a Date
stripTime(new Date('2026-02-28T15:30:00'))
// => Date('2026-02-28T00:00:00')

Danish Month Names

import { monthNameDa, monthNameDaRelative } from '@bemoje/date'

monthNameDa(new Date('2026-03-15'))
// => 'Marts'

monthNameDaRelative(new Date())
// => relative month name in Danish