
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
Delay function calls until a set time elapses after the last invocation
npm install debounce
import debounce from 'debounce';
function resize() {
console.log('height', window.innerHeight);
console.log('width', window.innerWidth);
}
window.onresize = debounce(resize, 200);
To check if the debounce delay is currently active:
window.onresize.isPending;
To later clear the timer and cancel currently scheduled executions:
window.onresize.clear();
Execute immediately only if a call is pending (and reset the timer):
window.onresize.flush();
To execute immediately and reset the timer if it was previously set:
window.onresize.trigger();
Creates a debounced function that delays execution until wait milliseconds have passed since its last invocation.
Set the immediate option to true to execute the function immediately at the start of the wait interval, preventing issues such as double-clicks on a button.
The returned function has the following methods:
.isPending indicates whether the debounce delay is currently active..clear() cancels any scheduled executions..flush() if an execution is scheduled then it will be immediately executed and the timer will be cleared..trigger() executes the function immediately and clears the timer if it was previously set.lodash.debounce is a function from the popular Lodash library that provides debouncing capabilities. It is similar to debounce but comes with additional options for leading and trailing invocation, and maxWait time. Lodash's debounce is often preferred for its extended functionality and reliability within the Lodash ecosystem.
throttle-debounce is a package that offers both throttle and debounce functions. While debounce delays function execution, throttle ensures that a function is only called at most once in a specified period. This package is useful for those who need both functionalities and prefer a combined solution.
p-debounce is a package that provides debouncing functionality for promises. It is similar to debounce but is specifically designed to work with functions that return promises, ensuring that a promise-returning function is not invoked too frequently.
FAQs
Delay function calls until a set time elapses after the last invocation
The npm package debounce receives a total of 14,518,546 weekly downloads. As such, debounce popularity was classified as popular.
We found that debounce demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.