idle-timer

1.2.0 • Public • Published

idle-timer

Checks if a user is idle for a configurable amount of time and fires a callback

Build Status

Usage

var timer = idleTimer({
  // function to fire after idle
  callback: callbackFn,
  // function to fire when active
  activeCallback: activeCallbackFn,
  // Amount of time in milliseconds before becoming idle. default 60000
  idleTime: 5000
})
function callbackFn () {
  console.log("You're idle!");
}
 
// when no longer needed, destroy() will remove
// all of the event listeners and clear the timeouts
timer.destroy();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    934
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    934
  • 1.1.0
    1
  • 1.0.1
    1
  • 1.0.0
    2

Package Sidebar

Install

npm i idle-timer

Weekly Downloads

768

Version

1.2.0

License

MIT

Last publish

Collaborators

  • orrybaram