Skip to content

Software

rclnodejs

By Robot Web Tools, from github.com/RobotWebTools/rclnodejs (opens in a new tab)

  • Middleware
  • Library
  • Apache-2.0

A Node.js client library for ROS 2 offering JavaScript and TypeScript APIs to build ROS 2 applications, including topics, services, actions and parameters.

Facts

GitHub stars
454read on 28 Nov 2026
Last update
27 Nov 2026Newest commit on develop
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate

Checked on GitHub on 29 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit 5fbe5d1 (opens in a new tab), on 29 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Provides topics, services, actions, parameters and lifecycle nodes for ROS 2 from Node.js.
  • Ships TypeScript declarations and supports RxJS Observable subscriptions for message pipelines.
  • Offers rclnodejs/web, a typed layer that allow-lists ROS 2 capabilities, reachable over WebSocket or HTTP.
  • Provides rosocket, a thin WebSocket gateway with no browser dependencies for simple prototypes.
  • Auto-generates JavaScript bindings and TypeScript declarations for ROS 2 message, service and action interfaces.
  • Includes Electron integration for desktop visualization apps and examples for Linux and Windows.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's website (opens in a new tab)
Maintenance
Active, last commit on 27 Nov 2026.

Use it

How to install it, in the creator's words: The project's website (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 5fbe5d1

Robotheca read the repository at two versions: the summary at 1580761 and the facts and the README at 5fbe5d1 (read on 29 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by Robot Web Tools, at commit 5fbe5d1, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

rclnodejs - The ROS 2 Client Library for JavaScript

(opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab)

(opens in a new tab)

Nightly Compatibility checks: ROS Rolling nightlies (opens in a new tab) with Node.js 27 alpha (opens in a new tab). See the build documentation (opens in a new tab).

rclnodejs is a Node.js client library for ROS 2 (opens in a new tab) with JavaScript and TypeScript APIs. It supports topics, services, actions, parameters, lifecycle nodes, RxJS subscriptions, and Electron and browser apps.

Start with Writing Your First rclnodejs Nodes (opens in a new tab) for setup, topics, and service calls.

import rclnodejs from 'rclnodejs';

await rclnodejs.init();
const node = new rclnodejs.Node('publisher_example_node');
const publisher = node.createPublisher('std_msgs/msg/String', 'topic');
publisher.publish(`Hello ROS 2 from rclnodejs`);
node.spin();
Documentation
Installation
Prerequisites

Source your ROS 2 environment before installing, building or running rclnodejs:

source /opt/ros/<distro>/setup.bash
Add rclnodejs to your project
npm i rclnodejs

Install an unpublished branch or commit with npm install RobotWebTools/rclnodejs#<branch>. GitHub installs and source checkouts need newer Node.js/npm versions than the runtime minimum; see the build guide (opens in a new tab).

Prebuilt binaries cover Ubuntu 22.04 (Humble), 24.04 (Jazzy), and 26.04 (Lyrical) on x64 and arm64. Other platforms build from source. Set RCLNODEJS_FORCE_BUILD=1 to force compilation, or use the Dockerfile (opens in a new tab) for container development.

Run the examples from a clone
npm install
node example/topics/publisher/publisher-example.mjs

More in example/ (opens in a new tab) and step-by-step guides in tutorials/ (opens in a new tab).

Bring ROS 2 to the Web

Build robot dashboards, control panels, and 3D visualizations in JavaScript or TypeScript. Your browser app connects to a Node.js runtime that handles ROS 2 communication.

Typed Web SDK

rclnodejs/web (opens in a new tab) provides call, publish, subscribe, and action, with payload types derived from your generated ROS interfaces.

  • Choose which services, topics, and actions to expose in web.json or CLI flags. Unlisted operations are rejected before reaching ROS 2.
  • Use WebSocket for all four operations, or HTTP/SSE for service calls, publishing, and actions. HTTP endpoints also work with curl and Postman.
  • Export OpenAPI 3.1 with rclnodejs-web openapi for API explorers and client generation.

With the runtime (opens in a new tab) and a ROS /add_two_ints service running:

import type {} from 'rclnodejs';
import { connect } from 'rclnodejs/web';

const ros = await connect('ws://localhost:9000/capability');
const reply = await ros.call<'example_interfaces/srv/AddTwoInts'>(
  '/add_two_ints',
  { a: '2n', b: '40n' }
);
console.log(reply.sum);
await ros.close();

SDK subscriptions and action cancellation use WebSocket; cancellation also requires server acceptance. Raw HTTP topic subscriptions are available with --http-sse.

Try Fibonacci actions in the browser (opens in a new tab), or watch a terminal-controlled manipulator in 3D (opens in a new tab). See all web demos (opens in a new tab) for setup and runnable code.

WebSocket URLs Without an SDK

rosocket (opens in a new tab) exposes one topic or service per WebSocket connection. Browser clients use only the built-in WebSocket and JSON APIs.

npx rosocket --host 127.0.0.1 --port 9000 --topic /chatter:std_msgs/msg/String
Observable Subscriptions

rclnodejs exposes topic subscriptions as RxJS (opens in a new tab) Observables. See the Observable Subscriptions Tutorial (opens in a new tab) for a runnable example and subscription cleanup.

Electron-based Visualization

See the Electron demos (opens in a new tab) for desktop ROS 2 apps and packaging with Electron Forge. The manipulator (opens in a new tab) uses Electron and Three.js to control a two-joint arm.

ROS 2 Interface Message Generation

rclnodejs generates JavaScript bindings and TypeScript declarations during npm install for ROS 2 .msg, .srv, and .action interfaces in your sourced environment.

After adding ROS interface packages, source their workspace and run from your project:

npx generate-ros-messages

JavaScript bindings are written to <your-project>/node_modules/rclnodejs/generated/ and TypeScript declarations to node_modules/rclnodejs/types/interfaces.d.ts. For custom .idl files, this repo also exposes npm run generate-messages-idl.

Using rclnodejs with TypeScript

The package includes TypeScript declarations. Use NodeNext module resolution in tsconfig.json:

{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "target": "es2022",
  },
}

See the TypeScript demos (opens in a new tab).

More
Contributing

Please read the Contributing Guide (opens in a new tab) before making a pull request.

Thanks to all contributors (opens in a new tab)!

License

Licensed under Apache 2.0 (opens in a new tab).

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.