npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vuejs-idle

v0.0.5

Published

A Vue.js plugin to detect idle or inactive users.

Downloads

14

Readme

VueJsIdle

VueJsIdle is a plugins to detect idle or inactive users.

Installation

This plugin can be installed by npm or yarn.

NPM

npm i vuejs-idle --save

Yarn

yarn add vuejs-idle

Basic usage

Vue.js

import { createApp } from "vue";
import VueJsIdle from 'vuejs-idle'

const app = createApp(App);
app.use(VueJsIdle);

app.mount("#app");

Component

Inside template use VueJsIdle component:

<VueJsIdle />

It will show timer counting down from 05:00 by default.

Options

@idle

Type: Function

Default: none

Executes when the timer reaches 00:00

<VueJsIdle @idle="onidle" />

@active

Type: Function

Default: none

Executes when the timer reaches 00:00 and any events is occurred.

<VueJsIdle @active="active" />

@prompt

Type: Function

Default: none

Executes when the timer reaches time in seconds before 00:00

<VueJsIdle
  @prompt="onprompt"
  :prompter_schedule="[5, 10, 20, 60]" />

prompter_schedule

Type: Array

Default: empty array

Array with seconds. Each value will execute @prompt

loop

Type: Boolean

Default: false

If set to true, timer will start execution again after 00:00

<VueJsIdle :loop="true" />

events

Type: Array

Default: ["mousemove", "keypress", "click", "scroll"]

Each event will break countdown.

<VueJsIdle :events="['mousemove', 'keypress', 'click', 'scroll']" />

wait

Type: Number

Default: 0

How many second to wait before starting countdown.

<VueJsIdle :wait="1" />

duration

Type: Number

Default: 300

Should be in seconds, default value is 300 seconds, so 5 minutes.

<VueJsIdle :duration="300" />

showTime

Type: Boolean

Default: true

If set to true, shows timer else hides' timer.

<VueJsIdle :showTime="true" />

Example

Create a timer for 300 seconds (5 minutes) with loop, remind 60 and 120 seconds before 00:00 with function onprompt(), wait 1 seconds before showing user the timer, execute function onidle() when the timer reaches 00:00.

<script setup>
import VueJsIdle from "@/components/VueJsIdle";
</script>

<template>
  <VueJsIdle
    :duration="300"
    :prompter_schedule="[60, 120]"
    :wait="1"
    :loop="false"
    @active="active"
    @idle="onidle"
    @prompt="onprompt"
    :show-time="true"
  />
</template>


<script>

export default {
  methods: {
    onidle() {
      console.log('Idle timeout.');
    },
    onprompt(time) {
      console.log(time);
    },
    active() {
      console.log('active')
    }
  }
}
</script>

<style scoped>

</style>

Tests

To run tests type:

npm run test:unit

License

MIT License (MIT).

Please see the license file for more information.