iosignal 2.1.0 → 2.2.0

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.
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export {version} from "./package.json";
2
2
  export { IOCongSocket } from './src/client/IOCongSocket.js'
3
- export { IOWS } from './src/client/IOWS.js'
3
+ export { IOWS as IO } from './src/client/IOWS.js'
4
4
  export { pack, CongRx } from './src/client/CongPacket.js'
5
5
  export { Server } from './src/server/Server.js'
6
6
  export { serverOption } from './src/server/serverOption.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iosignal",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "iosignal",
5
5
  "type": "module",
6
6
  "exports": {
@@ -8,17 +8,19 @@
8
8
  "import": "./dist/iosignal.mjs",
9
9
  "require": "./dist/iosignal.cjs"
10
10
  },
11
- "./iosignal.js": "./dist/iosignal.js"
11
+ "./io": "./dist/io.js",
12
+ "./io.js": "./dist/io.js",
13
+ "./browser": "./dist/io.js"
12
14
  },
13
- "browser": "./dist/iosignal.min.js",
14
- "jsdelivr": "./dist/iosignal.min.js",
15
- "unpkg": "./dist/iosignal.min.js",
15
+ "browser": "./dist/io.min.js",
16
+ "jsdelivr": "./dist/io.min.js",
17
+ "unpkg": "./dist/io.min.js",
16
18
  "devDependencies": {
17
19
  "@rollup/plugin-json": "^6.1.0",
18
- "@rollup/plugin-commonjs": "^26.0.1",
19
- "@rollup/plugin-node-resolve": "^15.2.3",
20
+ "@rollup/plugin-commonjs": "^28.0.0",
21
+ "@rollup/plugin-node-resolve": "^15.3.0",
20
22
  "@rollup/plugin-terser": "^0.4.4",
21
- "rollup": "^4.21.2"
23
+ "rollup": "^4.22.4"
22
24
  },
23
25
  "scripts": {
24
26
  "build": "rollup -c",
package/rollup.config.js CHANGED
@@ -8,12 +8,12 @@ export default [
8
8
  input: './src/client/IOWebSocket.js',
9
9
  output: [
10
10
  {
11
- file: './dist/iosignal.js',
11
+ file: './dist/io.js',
12
12
  format: 'es',
13
13
  sourcemap: true,
14
14
  },
15
15
  {
16
- file: './dist/iosignal.min.js',
16
+ file: './dist/io.min.js',
17
17
  format: 'umd',
18
18
  name: 'IO',
19
19
  sourcemap: true,
@@ -18,14 +18,14 @@
18
18
  <h2>Simple pub sub example.</h2>
19
19
  <p>you should start server first.</p>
20
20
  <p>this index.html load two types of modules. </p>
21
- <h5>1. UMD(IIFE): iosignal.min.js</h5>
21
+ <h5>1. UMD(IIFE): io.min.js</h5>
22
22
  <p>use global name: IO </p>
23
23
  <p>IO has props: Boho, MBP, Buffer,, </p>
24
24
  <h5>2. ESM: iosignal.js</h5>
25
25
  <p> check the console.</p>
26
26
  <h2>message log</h2>
27
27
  <div id="messageView">...</div>
28
- <script src="../dist/iosignal.min.js"></script>
28
+ <script src="../dist/io.min.js"></script>
29
29
  <script>
30
30
  console.log('IO.version: ', IO.version)
31
31
  console.log('MBP', IO.MBP)
@@ -82,7 +82,7 @@
82
82
  }
83
83
  </script>
84
84
  <script type="module">
85
- import IO from "../dist/iosignal.js"
85
+ import IO from "../dist/io.js"
86
86
  ESM_IO = IO
87
87
  console.log('ESM IO.version: ', IO.version)
88
88
  console.log('Boho', IO.Boho )
@@ -1,7 +1,7 @@
1
1
 
2
- const { IOWS } = require('iosignal')
2
+ const { IO } = require('iosignal')
3
3
 
4
- const io = new IOWS('ws://localhost:7777')
4
+ const io = new IO('ws://localhost:7777')
5
5
 
6
6
  io.on('ready', () => {
7
7
  console.log('ready cid:', io.cid)
@@ -1,7 +1,7 @@
1
1
 
2
- import { IOWS } from "iosignal"
2
+ import { IO } from "iosignal"
3
3
 
4
- const io = new IOWS('ws://localhost:7777')
4
+ const io = new IO('ws://localhost:7777')
5
5
 
6
6
  io.on('ready', () => {
7
7
  console.log('ready cid:', io.cid)
@@ -1,7 +1,7 @@
1
1
 
2
- import { IOWS } from "iosignal"
2
+ import { IO } from "iosignal"
3
3
 
4
- const io = new IOWS('ws://localhost:7777')
4
+ const io = new IO('ws://localhost:7777')
5
5
 
6
6
  io.on('ready', async () => {
7
7
  let res_echo = await io.req('reply', 'echo', 'hello')
@@ -1,4 +1,4 @@
1
- import { IOWS, Server } from 'iosignal'
1
+ import { IO, Server } from 'iosignal'
2
2
 
3
3
  let url = 'ws://localhost:5555'
4
4
  let server = new Server({
@@ -7,13 +7,13 @@ let server = new Server({
7
7
  })
8
8
  let done = false;
9
9
 
10
- let tx = new IOWS(url)
10
+ let tx = new IO(url)
11
11
  tx.on('ready', () => {
12
12
  console.log('tx ready', tx.cid)
13
13
  })
14
14
 
15
15
 
16
- let rx = new IOWS(url)
16
+ let rx = new IO(url)
17
17
  rx.on('ready', () => {
18
18
  console.log('rx ready', rx.cid)
19
19
  })