
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
idle-timeout
Advanced tools
A zero dependency, ~3KB library to make idle state detection in the browser an ease. With it's simple but yet powerful API it features everything you will ever need.
npm install idle-timeout
pnpm add idle-timeout
yarn add idle-timeout
<script src="https://unpkg.com/idle-timeout/dist/idle-timeout.min.umd.js"></script>
idleTimeout is totally easy to use. All you need to do is:
import idleTimeout from 'idle-timeout';
idleTimeout(() => {
console.log('Idle state detected.');
});
The idleTimeout constructor takes two arguments:
callback [Function] - The callback function (receives element and timeout as arguments)
element [Element] - The element that was listened for the timeouttimeout [Number] - The current timeout value in millisecondsoptions [Object] - An optional options object
element [Element] - The element to listen for the timeouttimeout [Number] - The idle timeout (in milliseconds)loop [Boolean] - Whether the timeout should be looped when idleconst instance = idleTimeout(
(element, timeout) => {
console.log(`Idle state detected on ${element} after ${timeout} ms`);
},
{
element: document,
timeout: 1000 * 60 * 5,
loop: false
}
);
pause() - Pauses the timeout
instance.pause();
resume() - Resumes an paused timeout
instance.resume();
reset() - Reset the timeout
instance.reset();
destroy() - Destroy the instance
instance.destroy();
idle [Boolean] - Whether the current state is idle
instance.idle; // false
timeout = value [Number] - Set the timeout (in milliseconds)
instance.timeout = 1000 * 60;
loop = value [Boolean] - Set whether the timeout should be looped
instance.loop = true;
idle = value [Boolean] - Set the idle state
instance.idle = true;
This project is licensed under the terms of the MIT License.
FAQs
The minimal idle state detector.
The npm package idle-timeout receives a total of 2,109 weekly downloads. As such, idle-timeout popularity was classified as popular.
We found that idle-timeout 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.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.