# cometd-nodejs-client

> Adapter code to run the CometD JavaScript library in a NodeJS environment

Latest version **2.0.0** (published 2024-05-21) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install cometd-nodejs-client
pnpm add cometd-nodejs-client
yarn add cometd-nodejs-client
bun add cometd-nodejs-client
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2024-05-21 |
| First published | 2017-03-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 64.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Maintainers | sbordet |
| Keywords | node, nodejs, cometd |

## Links

- npm: https://www.npmjs.com/package/cometd-nodejs-client
- Repository: https://github.com/cometd/cometd-nodejs-client
- Homepage: https://cometd.org
- Issues: https://github.com/cometd/cometd-nodejs-client/issues
- npm.io page: https://npm.io/package/cometd-nodejs-client

## Dependencies (4)

- [ws](https://npm.io/package/ws.md) >=8.0.0
- [cometd](https://npm.io/package/cometd.md) >=8.0.1
- [http-proxy-agent](https://npm.io/package/http-proxy-agent.md) >=7.0.0
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) >=7.0.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2024-05-21
- 2.0.0-BETA0 (beta) — 2019-11-05
- 1.5.0 — 2023-12-19
- 1.4.0 — 2023-03-20
- 1.3.0 — 2020-12-22
- 1.2.0 — 2020-07-30
- 1.1.0 — 2019-11-05
- 1.0.4 — 2019-07-11
- 1.0.3 — 2019-05-13
- 1.0.2 — 2017-09-13
- 1.0.1 — 2017-07-05
- 1.0.0 — 2017-06-08
- 1.0.0-BETA4 — 2017-06-06
- 1.0.0-BETA3 — 2017-05-04
- 1.0.0-BETA2 — 2017-04-10
- … 2 more at https://npm.io/package/cometd-nodejs-client/versions

## README

![NodeJS CI](https://github.com/cometd/cometd-nodejs-client/workflows/NodeJS%20CI/badge.svg)

## The CometD Project

### CometD NodeJS Client

This project implements ES6 adapter code that allows the [CometD JavaScript Client](https://github.com/cometd/cometd-javascript) to run in NodeJS 18.x or greater.

The adapter code exports an implementation of `XMLHttpRequest` and `WebSocket` so that the CometD JavaScript Client works in NodeJS as it does within a browser environment.

WebSocket is supported via the [`ws`](https://www.npmjs.com/package/ws) package.

### NPM Installation

Install the CometD NodeJS Client:

```js
npm install cometd-nodejs-client
```

### Usage (ES6)

```js
import { adapt } from "cometd-nodejs-client";
import { CometD } from "cometd";

// Shim XMLHTTPRequest for Node.js (required by CometD).
adapt();

// Your normal CometD client application here.
const client = new CometD();
```

See [here](https://github.com/cometd/cometd-javascript/blob/master/README.md) for an example CometD client application.

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