interval-queue
Advanced tools
| "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", |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
3529
82.47%7
250%61
Infinity%0
-100%