Have ideas to improve npm?Join in the discussion! »

node-lsl
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

node-lsl

Lab stream layerl (LSL) bindings for node.js.

Build Status

Not all functions are currently available - pull requests are welcome (please also include a relevant test).

Usage example:

const lsl = require('node-lsl');
const numChannels = 3;
const info = lsl.create_streaminfo("Dummy", "EEG", numChannels, 100, lsl.channel_format_t.cft_float32, "Dummy EEG Device");
const desc = lsl.get_desc(info);
lsl.append_child_value(desc, "manufacturer", "Random Inc.");
const channels = lsl.append_child(desc, "channels");
for (let i = 0; i < numChannels; i++) {
    const channel = lsl.append_child(channels, "channel");
    lsl.append_child_value(channel, "label", "Channel " + i);
    lsl.append_child_value(channel, "unit", "microvolts");
    lsl.append_child_value(channel, "type", "EEG");
}
 
const outlet = lsl.create_outlet(info, 0, 360);
setInterval(function() {
    const samples = [];
    for (= 0; i < numChannels; i++) {
        samples.push(Math.random());
    }
    lsl.push_sample_ft(outlet, new lsl.FloatArray(samples), lsl.local_clock());
}, 10);

Keywords

none

Install

npm i node-lsl

DownloadsWeekly Downloads

10

Version

0.1.0

License

MIT

Last publish

Collaborators

  • avatar