🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

interval-queue

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

interval-queue - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+28
dist/cjs/index.js
"use strict";
/**
* @description Interval utility functions
* @fileoverview Interval utility functions
* @module utils/interval
* @requires NodeJS
* @requires NodeJS.Timeout
*
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.clearIntervals = exports.createInterval = void 0;
const loops = [];
const createInterval = (time, fn) => {
const loop = setInterval(fn, time);
loops.push(loop);
return loop;
};
exports.createInterval = createInterval;
const clearIntervals = () => {
loops.forEach(loop => {
try {
clearInterval(loop);
}
catch (e) { }
});
};
exports.clearIntervals = clearIntervals;
process.on('SIGINT', exports.clearIntervals);
{
"type": "commonjs"
}
/**
* @description Interval utility functions
* @fileoverview Interval utility functions
* @module utils/interval
* @requires NodeJS
* @requires NodeJS.Timeout
*
*/
export declare const createInterval: (time: number, fn: () => void) => NodeJS.Timeout;
export declare const clearIntervals: () => void;
/**
* @description Interval utility functions
* @fileoverview Interval utility functions
* @module utils/interval
* @requires NodeJS
* @requires NodeJS.Timeout
*
*/
const loops = [];
export const createInterval = (time, fn) => {
const loop = setInterval(fn, time);
loops.push(loop);
return loop;
};
export const clearIntervals = () => {
loops.forEach(loop => {
try {
clearInterval(loop);
}
catch (e) { }
});
};
process.on('SIGINT', clearIntervals);
{
"type": "module"
}
+1
-1
{
"name": "interval-queue",
"version": "1.0.0",
"version": "1.0.1",
"description": "interval queue",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",