# stompjs

> STOMP for JavaScript apps (Web browser & node.js)

Latest version **2.3.3** (published 2014-07-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install stompjs
pnpm add stompjs
yarn add stompjs
bun add stompjs
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.3 |
| Published | 2014-07-04 |
| First published | 2013-09-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | separate (@types/stompjs) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1446 |
| Author | Jeff Mesnil |
| Maintainers | jmesnil |
| Keywords | STOMP, Web sockets, messaging, queue |

## Links

- npm: https://www.npmjs.com/package/stompjs
- Repository: https://github.com/jmesnil/stomp-websocket
- Issues: https://github.com/jmesnil/stomp-websocket/issues
- npm.io page: https://npm.io/package/stompjs

## Dependencies (1)

- [websocket](https://npm.io/package/websocket.md) latest

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 2.3.3 (latest) — 2014-07-04
- 2.3.2 — 2014-06-18
- 2.3.1 — 2014-02-18
- 2.3.0 — 2013-09-25
- 2.2.0 — 2013-09-25
- 2.1.0-next — 2013-09-25

## README

# STOMP.js

This library provides a STOMP client for Web browser (using Web Sockets) or node.js applications (either using raw TCP sockets or Web Sockets).

## Web Browser support

The library file is located in `lib/stomp.js` (a minified version is available in `lib/stomp.min.js`).
It does not require any dependency (except WebSocket support from the browser or an alternative to WebSocket!)

Online [documentation][doc] describes the library API (including the [annotated source code][annotated]).

## node.js support

Install the 'stompjs' module

    $ npm install stompjs

In the node.js app, require the module with:

    var Stomp = require('stompjs');

To connect to a STOMP broker over a TCP socket, use the `Stomp.overTCP(host, port)` method:

    var client = Stomp.overTCP('localhost', 61613);

To connect to a STOMP broker over a WebSocket, use instead the `Stomp.overWS(url)` method:

    var client = Stomp.overWS('ws://localhost:61614');

## Development Requirements

For development (testing, building) the project requires node.js. This allows us to run tests without the browser continuously during development (see `cake watch`).

    $ npm install

## Building and Testing

[![Build Status](https://secure.travis-ci.org/jmesnil/stomp-websocket.png)](http://travis-ci.org/jmesnil/stomp-websocket)

To build JavaScript from the CoffeeScript source code:

    $ cake build

To run tests:

    $ cake test

To continuously run tests on file changes:

    $ cake watch


## Browser Tests

* Make sure you have a running STOMP broker which supports the WebSocket protocol
 (see the [documentation][doc])
* Open in your web browser the project's [test page](browsertests/index.html)
* Check all tests pass

## Use

The project contains examples for using stomp.js
to send and receive STOMP messages from a server directly in the Web Browser or in a WebWorker.

## Authors

 * [Jeff Mesnil](http://jmesnil.net/)
 * [Jeff Lindsay](http://github.com/progrium)

[doc]: http://jmesnil.net/stomp-websocket/doc/
[annotated]: http://jmesnil.net/stomp-websocket/doc/stomp.html

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