New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

node-controllab

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-controllab

A Javascript module to interface with the LEGO DACTA Control Lab.

latest
npmnpm
Version
2.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

node-controllab - A Javascript module to interface with the LEGO DACTA Control Lab.

Installation

Node.js v22.0+ required.

npm install node-controllab --save

Example

import ControlLab, { TouchEvent } from "../dist/index.js";

const controlLab = new ControlLab("/dev/tty.usbserial-AC018KSE");  // Change this to your serial port

const INPUT_PORT = 1;
const OUTPUT_PORT = "B";

(async () => {

    await controlLab.connect();

    console.log("Connected to Control Lab!");

    controlLab.setTouchSensor(INPUT_PORT);  // Set input port 1 to a touch sensor
    controlLab.on("touch", ({ event }) => {
        if (event === TouchEvent.Pressed) {
            console.log(`Starting motor on output port ${OUTPUT_PORT} at power 8`);
            controlLab.setPower(OUTPUT_PORT, 8); // Drive motor on port A forward at full power (range is -8 to 8)
        } else if (event === TouchEvent.Released) {
            console.log(`Stopping motor on output port ${OUTPUT_PORT}`);
            controlLab.setPower(OUTPUT_PORT, 0); // Stop motor on port A
        }
    });

})();

More examples available in the examples directory.

FAQs

Package last updated on 15 Dec 2025

Did you know?

Socket

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.

Install

Related posts