ws-stomp-server 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -5
  3. package/package.json +2 -5
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 mivui
3
+ Copyright (c) 2026 mivui
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -76,14 +76,14 @@ import express from 'express';
76
76
  import { Stomp } from 'ws-stomp-server';
77
77
 
78
78
  const app = express();
79
- app.get('/send', (req, res) => {
79
+ app.get('/send', (_, res) => {
80
80
  Stomp.publish('/topic/test', JSON.stringify({ name: 'hello word!' }));
81
- res.status(200);
81
+ res.status(200).json({});
82
82
  });
83
83
  const server = app.listen(8080);
84
84
  Stomp.server(server, '/ws');
85
- Stomp.subscribe('/topic/test', (e) => {
86
- const body = e.body;
85
+ Stomp.subscribe('/topic/test', (message) => {
86
+ console.log(message.body);
87
87
  });
88
88
  ```
89
89
 
@@ -95,7 +95,9 @@ import { Client } from '@stomp/stompjs';
95
95
  const client = new Client({
96
96
  brokerURL: 'ws://localhost:8080/ws',
97
97
  onConnect: () => {
98
- client.subscribe('/topic/test', (message) => console.log(message.body);
98
+ client.subscribe('/topic/test', (message) => {
99
+ console.log(message.body);
100
+ });
99
101
  client.publish({ destination: '/topic/test', body: 'First Message' });
100
102
  },
101
103
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws-stomp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "ws-stomp-server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -9,10 +9,7 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "test": "vitest",
13
- "eslint": "eslint --fix **/*.{ts,js}",
14
- "rollup": "rollup -c rollup.config.js",
15
- "build": "npm run rollup"
12
+ "build": "rollup -c rollup.config.js"
16
13
  },
17
14
  "exports": {
18
15
  ".": {