# roslib

> The standard ROS Javascript Library

Latest version **2.1.0** (published 2026-03-03) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install roslib
pnpm add roslib
yarn add roslib
bun add roslib
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2026-03-03 |
| First published | 2014-04-01 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 7 |
| Unpacked size | 290.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 827 |
| Author | Robot Webtools Team |
| Maintainers | alanm, jihoonl, nuclearsandwich, mdevolving, matthijsburgh, ezrabrooks |
| Keywords | ROS, ros, roslib, roslibjs, robot |

## Links

- npm: https://www.npmjs.com/package/roslib
- Repository: https://github.com/RobotWebTools/roslibjs
- Homepage: https://robotwebtools.github.io
- Issues: https://github.com/RobotWebTools/roslibjs/issues
- npm.io page: https://npm.io/package/roslib

## Dependencies (7)

- [ws](https://npm.io/package/ws.md) ^8.19.0
- [bson](https://npm.io/package/bson.md) ^7.2.0
- [uuid](https://npm.io/package/uuid.md) ^13.0.0
- [cbor2](https://npm.io/package/cbor2.md) ^2.2.1
- [fast-png](https://npm.io/package/fast-png.md) ^8.0.0
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^5.0.1
- [@xmldom/xmldom](https://npm.io/package/@xmldom/xmldom.md) ^0.9.8

## Recent versions

- 2.1.0 (latest) — 2026-03-03
- 2.0.0-alpha7 (next) — 2025-11-18
- 2.0.1 — 2025-12-11
- 2.0.0 — 2025-11-19
- 2.0.0-alpha6 — 2025-11-17
- 2.0.0-alpha5 — 2025-11-17
- 1.4.1 — 2023-12-04
- 1.4.0 — 2023-12-04
- 1.3.0 — 2022-05-03
- 1.2.0 — 2022-01-08
- 1.1.0 — 2020-03-03
- 1.0.1 — 2019-02-08
- 1.0.0 — 2019-01-25
- 0.20.0 — 2018-01-04
- 0.19.0 — 2017-10-30
- … 14 more at https://npm.io/package/roslib/versions

## README

# roslibjs

[![CI](https://github.com/RobotWebTools/roslibjs/actions/workflows/main.yml/badge.svg)](https://github.com/RobotWebTools/roslibjs/actions/workflows/main.yml)

## The Standard ROS JavaScript Library

[JSDoc](https://robotwebtools.github.io/roslibjs) can be found on the Robot Web Tools website.

This project is released as part of the [Robot Web Tools](https://robotwebtools.github.io/) effort.

## Usage

Install roslibjs with any NPM-compatible package manager via, for example,

```bash
npm install roslib
```

## Troubleshooting

1. Check that connection is established. You can listen to error and
   connection events to report them to console.

   ```js
   ros.on("error", function (error) {
     console.log(error);
   });
   ros.on("connection", function () {
     console.log("Connection made!");
   });
   ```

   Check out the `roslib-examples` package for some complete examples!

2. Check that you have the websocket server is running on
   port 9090. Something like this should do:

   ```bash
   netstat -a | grep 9090
   ```

## Dependencies

roslibjs has a number of dependencies. You will need to run:

```bash
npm install
```

Depending on your build environment.

## Development

roslibjs tries to keep the development process simple by storing all relevant tasks as scripts in the package.json file.
Some useful ones are as follows:

### Building

```bash
npm run build
```

### Testing

```bash
npm run test
```

### Linting

```bash
npm run lint
```

## License

roslibjs is released with a BSD license. For full terms and conditions, see the [LICENSE](LICENSE) file.

## Authors

See the `contributors` section of the [package.json](package.json) file for a full list of contributors.

---
_Source: https://npm.io/package/roslib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
