
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
dev-input-reader
Advanced tools
Read input from /dev/input/* on a linux Host.
Dual Stack package ESM + CJS, should work in deno
With raw events:
// use RAW event
const reader = new DevInputReader('event0');
reader.on('error', console.error)
.on("keyup", (data) => console.log('keyup:', data))
.on("keypress", (data) => console.log('keypress:', data));
With syntetic events (recommanded):
// use simple events
const reader = new DevInputReader('event0'm { retryInterval: 10000});
reader.on('error', console.error)
.on("key", (data) => console.log('key:', data))
.on("error", (data) => console.log('an error occure:', data))
// data contain the durration of the press and the concurently press key
// in case oh hardware lost, will reconnect every retryInterval 10sec
With syntetic events with double/long click detection (if needed):
// use simple events
const reader = new DevInputReader('event0', { retryInterval: 10000, longPress: 5000, doublePress: 300 });
reader.on('error', console.error)
.on("simple", (data) => console.log('simple press:', data))
.on("double", (data) => console.log('double press:', data))
.on("long", (data) => console.log('long press:', data))
// long press is trigered if you keep a key pressed for more than 5 seconds
// double press is trigered if press a key 2 time within 300 ms
// in case oh hardware lost, will reconnect every retryInterval 10sec
Why a new Module ?
There is a lot of existing module that can deal with input:
Relative package:
FAQs
read input from /dev/input/*
The npm package dev-input-reader receives a total of 0 weekly downloads. As such, dev-input-reader popularity was classified as not popular.
We found that dev-input-reader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.