
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
cometd-nodejs-client
Advanced tools
Adapter code to run the CometD JavaScript library in a NodeJS environment
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.
Install the CometD NodeJS Client:
npm install cometd-nodejs-client
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.
FAQs
Adapter code to run the CometD JavaScript library in a NodeJS environment
The npm package cometd-nodejs-client receives a total of 3,718 weekly downloads. As such, cometd-nodejs-client popularity was classified as popular.
We found that cometd-nodejs-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.