npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rclnodejs

v2.1.0

Published

ROS2.0 JavaScript client with Node.js

Downloads

27,433

Readme

rclnodejs

rclnodejs is a Node.js client library for ROS 2 that provides JavaScript and TypeScript APIs for building ROS 2 applications.

Supported ROS 2 distributions include Humble, Jazzy, Kilted, Lyrical, and Rolling.

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();

This example assumes your ROS 2 environment is already sourced.

Installation

Prerequisites

Before installing or running rclnodejs, source your ROS 2 environment:

source /opt/ros/<distro>/setup.bash

Install rclnodejs

npm i rclnodejs

To install from GitHub instead of npm, run:

npm install RobotWebTools/rclnodejs#<branch>

Prebuilt Binaries

rclnodejs ships with prebuilt native binaries for common Linux configurations, so most installs skip compilation.

Supported Platforms:

  • Ubuntu 22.04 (Jammy) - ROS 2 Humble
  • Ubuntu 24.04 (Noble) - ROS 2 Jazzy, Kilted
  • Ubuntu 26.04 (Resolute) - ROS 2 Lyrical
  • Architectures: x64, arm64
  • Node.js: >= 20.20.2 (N-API compatible)

Installations outside this matrix automatically fall back to building from source. To force a source build even when a prebuilt binary is available:

export RCLNODEJS_FORCE_BUILD=1
npm install rclnodejs

Documentation and Examples

Message Generation

rclnodejs auto-generates JavaScript message interfaces and TypeScript declarations during npm install, so in most projects you do not need to run anything by hand. If you install additional ROS packages after rclnodejs was installed, re-run the generator from your project so the new interfaces are picked up:

npx generate-ros-messages

Generated files are written to <your-project>/node_modules/rclnodejs/generated/.

Using rclnodejs with TypeScript

TypeScript declaration files are included in the package. In most projects, configuring your tsconfig.json is sufficient:

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

Then import * as rclnodejs from 'rclnodejs' works the same as the JavaScript example at the top of this README.

ROS 2 in the browser

rclnodejs ships two ways to reach ROS 2 from the browser — pick one based on how much glue you want to write.

  • rclnodejs/web — typed, allow-listed, curl-able browser SDK. A web.json file is your public API; the browser SDK types call / publish / subscribe end-to-end from your ROS 2 message types; every capability is also a plain HTTP endpoint (curl -X POST http://<host>/capability/call/<name>), so shell scripts, Postman, and AI-agent tool-use just work. New in 2.0.0-beta.0.

    import { connect } from 'rclnodejs/web';
    const ros = await connect('ws://host:9000/capability');
    const reply = await ros.call<'example_interfaces/srv/AddTwoInts'>(
      '/add_two_ints', { a: '2n', b: '40n' }
    ); // reply.sum is typed as `${number}n`

    See the Web SDK guide.

  • rosocket — thin WebSocket gateway, zero browser dependencies (just built-in WebSocket + JSON). Best for quick prototypes and roslibjs-style apps.

    npx rosocket --port 9000 --topic /chatter:std_msgs/msg/String

    See the rosocket guide.

License

Apache License 2.0