Skip to content

Commit 840e977

Browse files
author
Deepak Kumar
committed
Updated STOMP.js references and clarified usage instructions.
1 parent 53d2542 commit 840e977

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

_posts/2018-06-29-using-stompjs-v5.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Ensure your STOMP broker supports STOMP over WebSockets. While some brokers supp
1919

2020
## Include stompjs
2121

22-
This npm package provides both a UMD build and ES modules. Web browsers can use the UMD build via a script tag, and Node.js (CommonJS `require`) and ES `import` will resolve to the appropriate builds.
22+
This npm package provides both a UMD build and ES modules. Web browsers can use the UMD build via a script tag. In Node.js, use ES module imports; CommonJS `require` is not supported.
2323

2424
### Polyfills
2525

@@ -29,8 +29,8 @@ _Important: For Node.js and React Native, please check [Polyfills]._
2929

3030
- Download and include directly from the `bundles/` folder.
3131
- Or use a CDN:
32-
- Minified: [https://cdn.jsdelivr.net/npm/@stomp/stompjs@5.0.0/bundles/stomp.umd.min.js](https://cdn.jsdelivr.net/npm/@stomp/stompjs@5.0.0/bundles/stomp.umd.min.js)
33-
- Unminified: [https://cdn.jsdelivr.net/npm/@stomp/stompjs@5.0.0/bundles/stomp.umd.js](https://cdn.jsdelivr.net/npm/@stomp/stompjs@5.0.0/bundles/stomp.umd.js)
32+
- Minified: [https://cdn.jsdelivr.net/npm/@stomp/stompjs@7.2.0/bundles/stomp.umd.min.js](https://cdn.jsdelivr.net/npm/@stomp/stompjs@7.2.0/bundles/stomp.umd.js)
33+
- Unminified: [https://cdn.jsdelivr.net/npm/@stomp/stompjs@7.2.0/bundles/stomp.umd.js](https://cdn.jsdelivr.net/npm/@stomp/stompjs@7.2.0/bundles/stomp.umd.js)
3434
- A global `StompJs` object will now be available. Read on to learn how to use it.
3535

3636
### In Node.js, TypeScript, or ES6
@@ -64,6 +64,8 @@ You can also pass them as key–value pairs to the [Client constructor](/api-doc
6464

6565
STOMP JavaScript clients communicate with a STOMP server using a `ws://` or `wss://` URL.
6666

67+
The example below shows how to use this library when included via a script tag. When included via an ES module, no need to prefix the class names with `StompJs.`. It will be `const client = new Client();`.
68+
6769
```javascript
6870
const client = new StompJs.Client({
6971
brokerURL: 'ws://localhost:15674/ws',

0 commit comments

Comments
 (0)