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

evdev

v0.3.0

Published

An Evdev events reader.

Downloads

99

Readme

Evdev reader for nodeJS

An Evdev events reader.

Quick test : see index.js. Will open any plugged joystick and display events as they come.

node index.js event-<your_event_type>
#Example with joysticks/gamepads :
node index.js "event-joystick"
# If you have multiple similar devices, you can select by index with a third argument :
node index.js "event-joystick" 1

This app is dead simple on purpose to be easily customizable without having to read tons of source code. Please note that this module's main purpose is to provide an easy programming interface for nodejs modules, not a full-featured command line interface.

How it works

Internals

Basics are simple : find event devices, open them and listen for events.

Events are parsed in plain js. C++ native code is only used to make queries.

Options

Example :

{
  raw:false
}

Options Explained

Raw

get raw events or parsed (with string instead of uints).

Opening streams

You can specify evdev files to open in options. Or call the search method.

var reader = new EvdevReader();
reader.search("/dev/input/by-path","event-joystick",function(err){
  //Err should be null.
});

Events

Raw events

When in raw mode, events are emitted under the name "event" with the structure : { time : {tv_sec: , tv_usec: }, type : , code : , value : }

Parsed events

Events are emitted under an "event_type" name, with this structure : { time : {tv_sec: , tv_usec: }, code : , value : }

TODO

  • Add more tests
  • The app require the running user to be a member of the "input" group. A VM should be provided to allow for easy testing without risking to compromise the system. Alternatively, I'd be best to find a lightweight solution to safely provide inputs when testing.
  • Need a way to discover input capabilities and vendor infos like libevdev's libevdev_has_event_code().

Useful resources

Importing event codes

Event codes are found here

Use this regex : .#define (\w)\s*(0?x?[0-9a-f]{1,3}) replace with : $2:"$1",