Skip to content
Utils for detecting inactive clients
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Utils for detecting inactive clients

Usage example

setInterval(function() {
    console.log('idle time: ' + $.idle());
}, 2000);

$.idle(30, function() {
    console.log('are you there?');

$.idle(60, function() {
    console.log('going away :)');

$.idle(0, function() {
    if ($.isAway()) {
        console.log('back from away');


Released under the MIT license



Return idle time in seconds


Return registered callbacks for specified seconds

$.idle(n, function)

Register a callback to be run when N idle seconds occurs


Mark the client as away


Mark the client as not away


Return wether the client is away or not

Something went wrong with that request. Please try again.