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 🙏

© 2026 – Pkg Stats / Ryan Hefner

click.js

v0.0.8

Published

Subscribe to system mouse/keyboard events.

Readme

Click.js will detect mouse and keyboard events using a tiny child process and allow you to subscribe to the event loop using Node. It also detects switching between windows and changes made to the clipboard. (Click.js is Windows only)

First an example

Easy as pie!

var clickjs = require('click.js')
var click = new clickjs()

click.on('keyInput', (event) => {
    console.log(event) // event contains details
})

click.start()
setTimeout(() => {
    click.done() // for sake of example, stop listening after 60 seconds
}, 60000)

Require

var clickjs = require('click.js')

Create

var click = new clickjs()

Methods

A clickjs object exists of three methods.

  • start()
  • done()
  • on()

Start

Start listening.

click.start()

Done

Kill the child.

click.done()

On

Subscribe to events.

click.on(type, callback(event))

Types

There are 5 event types with consistent properties.

  • keyInput (a key is pressed or released)
  • mouseInput (any mouse button is pressed or released)
  • clipboardModified (windows clipboard has been overwritten)
  • applicationWindowChange (user changed active window)

keyInput

A key on the keyboard is pressed or released.

mouseInput

A mousebutton contains the event (sub)type as well as the coordinates.

clipboardModified

In most cases the user has pressed ctrl+c.

applicationWindowChange

A window is minimized or whatever.

Event loop

Subscribe to events using simple on-method.

mouseInput

Subscribe to all mouse events. Mouse events include button down, button up, scrolling and cursor movement.

click.on('mouseInput', (event) => {
    console.log(event) // event also includes event type
})

Subscribe to other events

Subscribe to any of the 5 event types and console.log the event to see what info that gives you.

Subscribe to all available event types

This will not override the behavior of type specific callbacks but they will both be called.

click.on('*', (event) => {
    // this event can be anything! but not an error
})

Jochem Stoel

Involuntary public figure.