
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Package for manage function call timetable.
Since version 2.0.1 the contract for debounce and throttle methods has been changed. New contract is compatible for old throttle's contract but incompatible for debounce's contract in previous versions.
npm install fcronjs --save
Import fcronjs form package:
import fcronjs from 'fcronjs';
or add script fcron.js from web/fcron.js in branch master and add itinto your HTML:
<script src="./fcron.js"></script>
and use:
import { debounce } from 'fcronjs';
or
var debounce = fcronjs.debounce;
Method debounce creates Hi Ordered Function which sets minimal period between calls. It has two arguments:
{Function} func - original function.
{Object|number} [secondArgument] - in case Object - configurin object, in other case - [config#delay = 100].
Configuring object has 3 parameters:
For examlpe:
import { debounce } from 'fcronjs';
const f = debounce(console.log, {delay: 1000, immediate: false, context: console});
const timeouts = [0, 10, 100, 1000, 1010, 2000, 3000, 3500, 3550, 4200];
timeouts.forEach(x => setTimeout(f, x, x));
In output very likely will be 0, 1010, 3000, and 4200. And 10, 100, 1000, 2000, 3500 likely to be ignored.
import { throttle } from 'fcronjs';
or
var throttle = fcronjs.throttle;
Method throttle creates Hi Ordered Function which sets minimal period between calls and execute last call every time at the end.
{Function} func - original function.
{Object|number} [secondArgument] - in case Object - configurin object, in other case - [config#delay = 100].
Configuring object has 3 parameters:
For examlpe:
import { throttle } from 'fcronjs';
const f = throttle(console.log, 1000);
const timeouts = [0, 10, 100, 1000, 1010, 2000, 3000, 3500, 3550, 10000, 10001];
timeouts.forEach(x => setTimeout(f, x, x));
In output very likely will be 0, 1000, 1010 (as a last), 2000, 3000, and 3550 (as a last), 10000, and 10001 (as a last). And 10, 100, 3500 likely to be ignored.
import { waiter } from 'fcronjs';
or
var waiter = fcronjs.waiter;
Method waiter creates Hi Ordered Function which at call waits some time befor call original function, and in case of second call before function called, it stops waiting without calling function.
For examlpe:
import { waiter } from 'fcronjs';
const DELAY = 1000;
const f = waiter(console.log, DELAY);
f('Executing function must be called'); // will be executed after 1 second
setTimeout(() => {
f('Executing function must be ignored'); // Will never be executed
setTimeout(() => {
f(); // Canceling call after 500 ms.
}, DELAY / 2);
}, 5 * DELAY);
Supported browsers IE9+.
MIT Copyright (c) 2017 Kuznetsov Leonid.
FAQs
Package for manage function call timetable
We found that fcronjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.