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

devclockify-js

v1.0.0

Published

A full clock utility library — stopwatch, timer, alarm, audio & formatters.

Readme

clockify-js

A full clock utility library for JavaScript — stopwatch, timer, alarm, audio & formatters.


Install

npm install devclockify-js

Or use directly in the browser:

<script src="index.js"></script>
<!-- Then use window.devclockify.createStopwatch() etc. -->

Stopwatch

import { createStopwatch } from 'devclockify-js';

const sw = createStopwatch();

sw.onTick((ms, formatted) => {
  console.log(formatted); // "01:23.45"
});

sw.onLap((lap, allLaps) => {
  console.log('Lap:', lap.formatted);
});

sw.start();
sw.lap();
sw.pause();
sw.reset();

sw.getTime();  // "01:23.45"
sw.getLaps();  // [{n:1, t:5430, formatted:"00:05.43"}, ...]
sw.isRunning(); // true / false

Timer

import { createTimer } from 'devclockify-js';

const timer = createTimer();

timer.set(0, 5, 30); // 0 hours, 5 minutes, 30 seconds

timer.onTick((secondsLeft, formatted) => {
  console.log(formatted); // "05:30"
});

timer.onDone(() => {
  console.log('Timer done!');
});

timer.start();
timer.pause();
timer.reset();

timer.getTime();        // "04:58"
timer.getSecondsLeft(); // 298
timer.isRunning();      // true / false

Alarm

import { createAlarmManager } from 'devclockify-js';

const manager = createAlarmManager();

// Add alarms
manager.add('07:00', 'wake up', [1,2,3,4,5]); // Mon–Fri only
manager.add('09:00', 'weekend',  [0,6]);        // Sat & Sun only
manager.add('12:00', 'lunch');                  // every day

// Callbacks
manager.onRing((alarm) => {
  console.log('Ringing:', alarm.label);
  // stop after 10 seconds
  setTimeout(() => manager.stopRing(), 10000);
});

manager.onStop(() => {
  console.log('Alarm stopped');
});

// Start checking (must call this!)
manager.start();

// Manage alarms
manager.getAll();         // all alarms array
manager.toggle(alarmId);  // turn on/off
manager.delete(alarmId);  // remove
manager.clearAll();       // remove all
manager.isRinging();      // true / false
manager.getDayNames([1,2,3]); // ["Mon","Tue","Wed"]

Audio

import { makeBeep, startRinging, stopRinging } from 'devclockify-js';

makeBeep();           // default beep (880Hz, 0.35s)
makeBeep(440, 0.5);   // lower pitch, longer

const ring = startRinging();       // beeps every 500ms
stopRinging(ring);                 // stop it

Formatters

import { pad2, fmtSW, fmtTM } from 'devclockify-js';

pad2(5);       // "05"
pad2(12);      // "12"

fmtSW(75430);  // "01:15.43"  (milliseconds → MM:SS.cs)
fmtTM(3665);   // "01:01:05"  (seconds → HH:MM:SS)
fmtTM(125);    // "02:05"     (no hours if under 1hr)

License

MIT — free to use in any project.