browser-activity-monitor
v1.0.2
Published
A simple activity monitor to alert you when the user becomes active or inactive
Downloads
8
Maintainers
Readme
browser-activity-monitor
A simple activity monitor to alert you when the user becomes active or inactive
Installation
npm install browser-activity-monitor --save
Usage
import { ActivityMonitor, ACTIVE, INACTIVE } from 'browser-activity-monitor'
const monitor = new ActivityMonitor(document)
monitor.on(ACTIVE, () => console.log('User is active!'))
monitor.on(INACTIVE, () => console.log('User is inactive!'))
// ...
monitor.destroy()
Tests
npm test
License
Apache-2.0