🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@stream-io/worker-timer

Package Overview
Dependencies
Maintainers
8
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stream-io/worker-timer

Worker based timers for Stream.io JS-based SDKs and applications

latest
npmnpm
Version
1.2.5
Version published
Weekly downloads
32K
-4.9%
Maintainers
8
Weekly downloads
 
Created
Source

@stream-io/worker-timer

A Worker based implementation of the JS Timers API.

Usage

// import the library
import { WorkerTimer } from "@stream-io/worker-timer";

// create an instance
const timer = new WorkerTimer();

// with interval
const id = timer.setInterval(() => {
  console.log("Hello World from interval");
}, 1000);

// clear the interval
timer.clearInterval(id);

// with timeout
timer.setTimeout(() => {
  console.log("Hello World from timeout");
}, 1000);

// clear the timeout
timer.clearTimeout(id);

Advanced usage

You can also create a WorkerTimer instance with custom defaults:

const timer = new WorkerTimer({
  useWorker: false, // will fallback the Platform API
  name: "custom-timer", // name of the worker, for debugging purposes
});

Keywords

timer

FAQs

Package last updated on 27 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts