Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

idle-tracker

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

idle-tracker

Tiny pure Javascript library to track browser inactivity

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.4K
decreased by-5.85%
Maintainers
1
Weekly downloads
 
Created
Source

Idle Tracker

idle tracker
npm gzip size downloads

Tiny Javascript library to track browser idle status. (callback when user is idle).

Demo

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Samsung
Samsung
Opera
Opera
Edgelast versionlast 2 versionslast 2 versionslast 2 versionslast 2 versionslast 2 versions

Installation

via yarn

$ yarn add idle-tracker

or via npm

$ npm install idle-tracker

Usage

import IdleTracker from 'idle-tracker';

const idleTracker = new IdleTracker(options);

idleTracker.start(); // start tracker

idleTracker.end(); // stop tracker and release memory
Constructor options
Options NameTypeDefaultDescription
timeout (ms)number30000timeout to count as idle
onIdleCallbackFunctionnoopFunction to be called when idle status change, payload will be { idle: true/false }, with optional event payload
throttlenumber500throttle rate of callback

Future

  1. Browser might support this function natively in the future, see Idle Detection API
  2. Related newer API/Library: page-lifecycle, repo

Keywords

FAQs

Package last updated on 11 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc