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

@time-provider/addon-compat

v0.2.1

Published

Time-Provider : Compatibility addon ~ Your single time interface for all your JavaScript / TypeScript projects.

Readme

NPM types CodeQL check codecov npm downloads ![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen?cacheSeconds=86400 unpacked-size minified size openssf best practices license

Time-Provider ~ Compatibility Addon

Description

This is the compatibility addon for Time-Provider.
Extends the library with a .compat facade that exposes low-level-like methods signatures - the native-style timer calls and the performance members, flat on the same object. This is usefull if you want to migrate your codebase to TimeProvider while keeping your native low-level methods signatures.

Just like the plugin packages, this addon is tree-shakable.
It is split into a default (system/real-time) entry point and a deterministic one, so each import pulls in only the code it needs:

  • @time-provider/addon-compat - for a system (real time) Time-Provider created via @time-provider/core. Timers run on real native timers.
  • @time-provider/addon-compat/deterministic - for a deterministic Time-Provider (fixed/manual/sequential) created via @time-provider/core/deterministic. Timers run against that runtime's own simulated clock.

Usage

import { createTimeProvider } from "@time-provider/core";
import { createTimeProvider as createDeterministicTimeProvider } from "@time-provider/core/deterministic";
import { plugin } from "@time-provider/plugin-native";
import { plugin as deterministicPlugin } from "@time-provider/plugin-native/deterministic";
import { addon } from "@time-provider/addon-compat";
import { addon as deterministicAddon } from "@time-provider/addon-compat/deterministic";

// System: runs on real native timers, in the runtime's local timezone.
const timeProvider = createTimeProvider.for(plugin).use(addon).create();
const handle = timeProvider.compat.setTimeout(() => {
  console.info("Native setTimeout call style");
}, 500);
// ...
timeProvider.compat.clearTimeout(handle);
//same calls for setInterval/clearInterval...

timeProvider.compat.queueMicrotask(() => {
  console.info("Native queueMicrotask call style");
});

// The performance members are there too, with their native signatures.
timeProvider.compat.mark("request-start");
console.info(timeProvider.compat.now(), timeProvider.compat.timeOrigin);

// Deterministic: runs against the runtime's own simulated clock.
const manual = createDeterministicTimeProvider
  .for(deterministicPlugin)
  .use(deterministicAddon)
  .asManual()
  .withInitialTime("2024-01-01T00:00:00.000Z")
  .create();
const handle = manual.compat.setTimeout(() => {
  console.info("Native setTimeout call style");
}, 500);
// ...
manual.compat.clearTimeout(handle);
//same calls for setInterval/clearInterval...

Members other addons add

Composing @time-provider/addon-animation-frame or @time-provider/addon-idle after this addon adds their native-shaped aliases to the same .compat facade: requestAnimationFrame/cancelAnimationFrame and requestIdleCallback/cancelIdleCallback. Each cancel* takes the handle its request* returned. Compose this addon first - the facade has to exist by the time they are applied, and composed the other way round the aliases are simply absent.

License

MIT