You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2018-06-29-using-stompjs-v5.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Ensure your STOMP broker supports STOMP over WebSockets. While some brokers supp
19
19
20
20
## Include stompjs
21
21
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.
23
23
24
24
### Polyfills
25
25
@@ -29,8 +29,8 @@ _Important: For Node.js and React Native, please check [Polyfills]._
29
29
30
30
- Download and include directly from the `bundles/` folder.
- A global `StompJs` object will now be available. Read on to learn how to use it.
35
35
36
36
### 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
64
64
65
65
STOMP JavaScript clients communicate with a STOMP server using a `ws://` or `wss://` URL.
66
66
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();`.
0 commit comments