cometd-nodejs-client
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

NodeJS CI

The CometD Project

CometD NodeJS Client

This project implements ES6 adapter code that allows the CometD JavaScript Client 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 package.

NPM Installation

Install the CometD NodeJS Client:

npm install cometd-nodejs-client

Usage (ES6)

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 for an example CometD client application.

Readme

Keywords

Package Sidebar

Install

npm i cometd-nodejs-client

Homepage

cometd.org

Weekly Downloads

3,959

Version

2.0.0

License

Apache-2.0

Unpacked Size

65.8 kB

Total Files

16

Last publish

Collaborators

  • sbordet