New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

timerpro

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timerpro

Manage intervals and timeouts like a pro

npmnpm
Version
1.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Since intervals and timeouts lists are not saved on the browser. This package helps you to manage them.

Add “TimerPro” to your project:

const timerPro = require("timerpro");

Methods:

Create new timeout (setTimeout)

new_timeout(timerName, timerFN, timerDelay, timerArgs);

Example:
timerPro.new_timeout("MyRefresh", (msg) => {
	console.log(msg);
}, 500, "Hello world!);

Create new interval (setInterval)

new_interval(timerName, timerFN, timerDelay, timerArgs);

Example:
timerPro.new_interval("MyRefresh", (msg) => {
	console.log(msg);
}, 500, "Hello world!);

Get last timeout or interval ID

get_last_timeout_id(timerName);
get_last_interval_id(timerName);

Example:
get_last_timeout_id("MyRefresh");
get_last_interval_id("MyRefresh");

Get timeout or interval by ID

get_timeout_by_id(timerName, id);
get_interval_by_id(timerName, id);

Example:
get_timeout_by_id("MyRefresh", 1);
get_interval_by_id("MyRefresh", 1);

Clear timeout or interval by ID

clear_timeout_by_id(timerName, id);
clear_interval_by_id(timerName, id);

Example:
clear_timeout_by_id("MyRefresh", 1);
clear_interval_by_id("MyRefresh", 1);

Clear all the timeouts or intervals by name

clear_timeouts(timerName);
clear_intervals(timerName);

Example:
clear_timeouts("MyRefresh");
clear_intervals("MyRefresh");

Clear all the timeouts or intervals

clear_all_timeouts();
clear_all_intervals();

Example:
clear_all_timeouts();
clear_all_intervals();

Clear all the timeouts and intervals ever created

clear_all();

Example:
clear_all();

Get all the timeouts and intervals ever created

get_all();

Example:
console.log(get_all());

Clean and reorder finished and deleted timeouts or intervals

clean(type) // "Timeout", "Interval"

Example:
clean("Timeout");

Clean and reorder finished and deleted timeouts and intervals

clean_all();

Example:
clean_all();

Keywords

setTimeout

FAQs

Package last updated on 22 Dec 2022

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