Registry / messaging / stomp-websocket

stomp-websocket

JSON →
library2.3.4-nextjsnpmunverified

STOMP.js provides a STOMP messaging client for browser and Node.js applications, supporting WebSocket and TCP transports. The latest version is 2.3.4-next, last updated in 2015 and no longer maintained. It offers a simple API for connecting to STOMP brokers, subscribing to queues/topics, and sending messages. Key differentiators include lightweight no-dependency design for browsers and dual TCP/WebSocket support in Node.js. However, it lacks modern ESM support, TypeScript types, and has known issues with binary frames and reconnection. For new projects, consider active alternatives like @stomp/stompjs.

npm install stomp-websocket
INSTALL
IMPORT
SIG · STOMP-WEBSOCKET
S
stomp-websocket
messagingjavascriptv2.3.4-next
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Stomp
var Stomp = require('stompjs');
import Stomp from 'stompjs';
The package uses CommonJS; ESM import via default is unsupported without interop.
Client
var Stomp = require('stompjs'); var client = Stomp.client('ws://localhost:61614');
import { Client } from 'stompjs';
Client is not exported as a named symbol; instantiate via Stomp.client().
Frame
var Stomp = require('stompjs'); var frame = new Stomp.Frame('MESSAGE', {destination: '/queue/test'}, 'body');
const { Frame } = require('stompjs');
Frame constructor is accessed via Stomp.Frame, not as a destructured export.

Connects to a STOMP broker via WebSocket, subscribes to a queue, and sends a message.

var Stomp = require('stompjs'); var client = Stomp.client('ws://localhost:61614'); client.connect('guest', 'guest', function(frame) { console.log('Connected:', frame); client.subscribe('/queue/test', function(message) { console.log('Received:', message.body); }); client.send('/queue/test', {}, 'Hello, STOMP!'); });
Debug
Known issues
deprecatedThis project is no longer maintained.
fix
Switch to @stomp/stompjs or other actively maintained STOMP client.
affects: >=0.0.0
breakingNo ESM support; requires CommonJS require().
fix
Use dynamic import or bundler interop for ESM projects.
affects: >=0.0.0
gotchaStomp.client expects a WebSocket URL; use Stomp.overTCP for TCP sockets.
fix
For TCP connections: var client = Stomp.overTCP('localhost', 61613);
affects: >=0.0.0
gotchaDoes not handle reconnection automatically.
fix
Implement custom reconnection logic using client.onclose event.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Stomp.client is not a function
Using ES module import instead of CommonJS require.
fix
Use 'var Stomp = require("stompjs");' instead of ES import.
Error: connection closed before receiving a STOMP frame
Broker not running or wrong URL/protocol.
fix
Verify broker URL and ensure WebSocket is supported (use ws:// not http://).
Upgrade
Version history
2.3.4-nextlatest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
stomp-websocket — npm install stomp-websocket · libregistry