Registry / communication / etherpad-cli-client

etherpad-cli-client

JSON →
library3.0.5jsnpmunverified

The `etherpad-cli-client` package provides a Node.js and CLI interface for real-time interaction with Etherpad content. It allows developers to connect to an Etherpad instance, stream pad text, listen for real-time messages, and programmatically append or prefix content. The current stable version is 3.0.5. A critical design decision is that this client *requires* the connected Etherpad server to be running in `loadTest` mode, which fundamentally alters Etherpad's behavior and is not suitable for typical production environments. This limits its use to specific testing, automation, or specialized integration scenarios rather than full-fledged editor functionality. The project appears actively maintained, with continuous integration badges indicating ongoing development. Its core differentiator is its programmatic access to real-time Etherpad content, albeit under the `loadTest` mode constraint.

npm install etherpad-cli-client
INSTALL
IMPORT
SIG · ETHERPAD-CLI-CLIEN
E
etherpad-cli-client
communicationjavascriptv3.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
const Client = require('etherpad-cli-client');
import Client from 'etherpad-cli-client';
The package's default export is the `Client` class. Use CommonJS `require` for direct import. While Node.js ESM interop might allow `import Client from 'etherpad-cli-client'` in a module context, `require` is the explicit and most reliable method as it's a CJS module.
connect
const Client = require('etherpad-cli-client'); const pad = Client.connect('https://beta.etherpad.org/p/clitest');
const { connect } = require('etherpad-cli-client');
`connect` is a static method of the `Client` class, not a direct named export. You must access it via the imported `Client` object after importing the class itself.
pad instance methods
const Client = require('etherpad-cli-client'); const pad = Client.connect(); pad.on('connected', () => { /* ... */ }); pad.append('new content');
const pad = require('etherpad-cli-client').connect();
While technically possible for the `connect` method, directly chaining `require().connect()` can obscure the fact that `Client` is a class and methods like `on`, `append`, etc., are instance methods of the object returned by `Client.connect()`.

Demonstrates connecting to an Etherpad instance, listening for connection status, real-time messages, and updates to the pad's content, while also programmatically appending text. Requires the Etherpad server to be in `loadTest` mode for full functionality.

const Client = require("etherpad-cli-client"); // IMPORTANT: Ensure your Etherpad instance is in loadTest mode (settings.json -> loadTest: true). // This example connects to a public beta instance that may or may not be in loadTest mode. const pad = Client.connect("https://beta.etherpad.org/p/clitest"); pad.on("connected", function(padState){ console.log(`Connected to Etherpad at ${padState.host} with pad ID ${padState.padId}`); // Start appending content once connected let counter = 0; const intervalId = setInterval(() => { const textToAppend = `Hello from CLI Client! [${Date.now()}]\n`; console.log(`Appending: "${textToAppend.trim()}"`); pad.append(textToAppend); counter++; if (counter >= 3) { // Append a few times then stop clearInterval(intervalId); } }, 2000); }); pad.on("message", function(message){ console.log("New message from Etherpad Server:", message.type); // You can inspect message.data for specific Etherpad protocol details }); pad.on("newContents", function(atext){ console.log("\n--- Pad Contents Updated ---"); console.log(atext.text); console.log("----------------------------\n"); }); pad.on("disconnect", function(e){ console.log("Disconnected from pad:", e ? e.message : "gracefully"); process.exit(0); }); // Keep the process alive for a reasonable duration to observe real-time events setTimeout(() => { console.log("Exiting after 30 seconds to prevent indefinite running."); process.exit(0); }, 30000);
etherpad-cli-client --version
Debug
Known issues
breakingThis client requires the connected Etherpad server to be in `loadTest` mode. This is a non-standard configuration and will likely break normal Etherpad operations or prevent other clients from connecting correctly. Ensure `loadTest: true` is set in your Etherpad `settings.json`.
fix
Modify your Etherpad server's `settings.json` to include `"loadTest": true` and restart the Etherpad server.
affects: >=1.0.0
gotchaThe package explicitly requires Node.js version 18.0.0 or higher. Running on older Node.js versions may lead to unexpected errors or failures.
fix
Upgrade your Node.js environment to version 18.0.0 or later. Use a version manager like `nvm` to easily switch Node.js versions (e.g., `nvm install 18 && nvm use 18`).
affects: >=3.0.0
gotchaThe client offers limited functionality, primarily focusing on streaming, appending, and listening to pad content. It does not provide full editor feature parity, such as complex text manipulation, undo/redo, or user management that a standard Etherpad client offers.
fix
Understand the scope of this client. If you need full editor capabilities, consider alternative Etherpad API clients or direct browser-based interaction.
affects: >=1.0.0
gotchaThis package is distributed as a CommonJS module. While Node.js 18+ supports ESM, direct `import` statements might require specific configuration (`type: "module"` in `package.json` or dynamic `import()`) or may not behave as expected without proper interop handling.
fix
Prefer `const Client = require('etherpad-cli-client');` for importing the module in CommonJS environments. If using in an ESM project, use `import Client from 'etherpad-cli-client';` leveraging Node.js's CJS-ESM interop, but be aware of potential quirks.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Client side Etherpad installation needs to be in loadTest mode (settings.json)
The Etherpad server you are trying to connect to is not configured with `loadTest: true` in its `settings.json`.
fix
Edit your Etherpad server's `settings.json` file, add or set `"loadTest": true`, and restart the Etherpad server.
TypeError: Client.connect is not a function
You are attempting to destructure `connect` directly from the module or calling it incorrectly, rather than as a static method of the imported `Client` class.
fix
Ensure you import the `Client` class correctly using `const Client = require('etherpad-cli-client');` and then call its static method: `Client.connect(url);`.
ReferenceError: require is not defined
This error occurs in an ECMAScript Module (ESM) context when you try to use `require()` directly.
fix
If your project is configured with `"type": "module"` in `package.json`, use `import Client from 'etherpad-cli-client';` for CJS interoperability. Alternatively, switch your project to CommonJS by removing `"type": "module"`.
Upgrade
Version history
3.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
1
Resources