
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
node-buzzers
Advanced tools
Forked version of 'buzz-buzzers', updated and upgraded to support multiple USB dongles
node-buzzers
- Use the wired or wireless "Playstation Buzz" Buzzers with node.jsThis fork:
examples/multi-blink.js
)npm install node-buzzers
Before you use this library you need to connect your buzzers:
Then you can use this library like this:
var nodeBuzzers = require('node-buzzers');
var buzzers = nodeBuzzers();
var ledLight = true;
// Make all buzzers blinks
// this only works on the buzzers with an LED
setInterval(function () {
ledLight = !ledLight;
buzzers.setLeds(ledLight, ledLight, ledLight, ledLight);
}, 500);
// Get notified when a button is pressed
buzzers.onPress(function(ev) {
// ev is an object with two attributes:
// - controller: Number from 1 to 4
// - button: Number from 0 to 4. 0 is the big red button.
console.log('Button ' + ev.button + ' on controller ' + ev.controller + ' pressed');
});
// Get notified when a button is released
buzzers.onRelease(function(ev) {
console.log('Button ' + ev.button + ' on controller ' + ev.controller + ' released');
});
// Get notified whenever something changes
buzzers.onChange(function(state) {
// state is an array of booleans with all buttons
// false means the button is not pressed
// and true when a button is pressed
/* An example could look like this, in this case the second color button
of controller 2 was pressed and the big red button on controller four is pressed
[
false, false, false, false, false, // first controller
false, false, true, false, false, // second controller
false, false, false, false, false, // third controller
true, false, false, false, false // fourth controller
]
*/
});
// Get notified when an error happens
buzzers.onError(function(err) {
console.log('Error: ', err);
});
// Remove event listeners
// To remove a listener just call removeEventListener
// possible first parameter values are: press, release, change, error
// buzzers.removeEventListener('press', callback);
First you have to initialize the buzzers:
var buzzers = require('node-buzzers')();
buzzers
now has the following API:
onPress(callback)
Register a callback that is called whenever a button is pressed. It will be called with an event object in this format:
{
controller: 1, // which controller/buzzer was used. Number form 1-4
button: 0 // Which button was pressed. Number from 0 to 4. 0 is the big red button
}
onRelease(callback)
Register a callback that is called whenever a button is released. It will be called with an event object in this format:
{
controller: 1, // which controller/buzzer was used. Number form 1-4
button: 0 // Which button was pressed. Number from 0 to 4. 0 is the big red button
}
onChange(callback)
Register a callback that is called whenever any button changes it's state. Callback will be called with an array in the format
[
false, false, false, false, false, // buttons 0-4 of the first controller. true means pressed
false, false, true, false, false, // second controller
false, false, false, false, false, // third controller
true, false, false, false, false // fourth controller
]
onError(callback)
Register a callback that is called when an error happens
setLeds(redButton1, redButton2, redButton3, redButton4)
:To light up the red LEDs of a buzzer. Pass in true
to switch a light on and false
to switch it off. Note that this does not work on some older buzzers since they don't have an LED. For those devices onError
will be called when you call setLeds
examples/multi-blink.js
)FAQs
Forked version of 'buzz-buzzers', updated and upgraded to support multiple USB dongles
The npm package node-buzzers receives a total of 10 weekly downloads. As such, node-buzzers popularity was classified as not popular.
We found that node-buzzers 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.