
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
web-midi-api
Advanced tools
This package is deprecated and kept here for the old projects compatibility. It redirects to jzz:
// index.js:
module.exports = require('jzz');
If you are starting a new project, please consider using jzz directly.
npm install web-midi-api
var navigator = require('web-midi-api');
// consider using var navigator = require('jzz');
var midi;
var inputs;
var outputs;
function onMIDIFailure(msg) {
console.log('Failed to get MIDI access - ' + msg);
process.exit(1);
}
function onMIDISuccess(midiAccess) {
midi = midiAccess;
inputs = midi.inputs;
outputs = midi.outputs;
setTimeout(testOutputs, 500);
}
function testOutputs() {
console.log('Testing MIDI-Out ports...');
outputs.forEach(function(port) {
console.log('id:', port.id, 'manufacturer:', port.manufacturer, 'name:', port.name, 'version:', port.version);
port.open();
port.send([0x90, 60, 0x7f]);
});
setTimeout(stopOutputs, 1000);
}
function stopOutputs() {
outputs.forEach(function(port) {
port.send([0x80, 60, 0]);
});
testInputs();
}
function onMidiIn(ev) {
var arr = [];
for(var i = 0; i < ev.data.length; i++) {
arr.push((ev.data[i] < 16 ? '0' : '') + ev.data[i].toString(16));
}
console.log('MIDI:', arr.join(' '));
}
function testInputs() {
console.log('Testing MIDI-In ports...');
inputs.forEach(function(port) {
console.log('id:', port.id, 'manufacturer:', port.manufacturer, 'name:', port.name, 'version:', port.version);
port.onmidimessage = onMidiIn;
});
setTimeout(stopInputs, 5000);
}
function stopInputs() {
console.log('Thank you!');
navigator.close(); // This will close MIDI inputs, otherwise Node.js will wait for MIDI input forever.
process.exit(0);
}
navigator.requestMIDIAccess().then(onMIDISuccess, onMIDIFailure);
FAQs
Web MIDI API for Node.js
The npm package web-midi-api receives a total of 639 weekly downloads. As such, web-midi-api popularity was classified as not popular.
We found that web-midi-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.