nep-cli 0.2.3 → 0.2.4
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/bin/index.js +9 -6
- package/package.json +2 -2
package/bin/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { program } = require('commander');
|
|
4
4
|
const { version } = require('../package.json');
|
|
@@ -14,7 +14,7 @@ const open = require('open'); // Import the 'open' package
|
|
|
14
14
|
const express = require('express');
|
|
15
15
|
const http = require('http');
|
|
16
16
|
const socketIo = require('socket.io');
|
|
17
|
-
const fs = require('fs');
|
|
17
|
+
const fs = require ('fs');
|
|
18
18
|
const zmqc = require("zeromq/v5-compat");
|
|
19
19
|
|
|
20
20
|
const PORT_MASTER_INFO = 50001; // Default port for master info
|
|
@@ -26,6 +26,7 @@ program
|
|
|
26
26
|
.version(version)
|
|
27
27
|
.description('NEP-CLI')
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
program
|
|
30
31
|
.command('ip')
|
|
31
32
|
.description('Display current Wi-Fi and Ethernet IP addresses of this computer')
|
|
@@ -515,7 +516,6 @@ program
|
|
|
515
516
|
}
|
|
516
517
|
});
|
|
517
518
|
|
|
518
|
-
|
|
519
519
|
program
|
|
520
520
|
.command('topics')
|
|
521
521
|
.description('Displays the list of NEP+ topics')
|
|
@@ -569,10 +569,11 @@ program
|
|
|
569
569
|
await getTopics(); // Call the function to get topics
|
|
570
570
|
});
|
|
571
571
|
|
|
572
|
+
|
|
572
573
|
program
|
|
573
574
|
.command('show [topic] [index]')
|
|
574
575
|
.description('Displays messages published to a specified NEP+ topic in the default browser. ' +
|
|
575
|
-
'The [index] parameter specifies the index of the
|
|
576
|
+
'The [index] parameter specifies the port index of the server that is connected to the web browser for displaying messages. It must be a number between 0 and 49'
|
|
576
577
|
)
|
|
577
578
|
.action(async (topic, index) => {
|
|
578
579
|
const ip = "127.0.0.1";
|
|
@@ -849,11 +850,13 @@ const selectTimeout = async (defaultTimeout = 1000) => {
|
|
|
849
850
|
};
|
|
850
851
|
|
|
851
852
|
program
|
|
852
|
-
.command('record [topic]
|
|
853
|
+
.command('record [topic]')
|
|
853
854
|
.description('Record messages from a NEP+ topic to a file')
|
|
854
|
-
.action(async (topic
|
|
855
|
+
.action(async (topic) => {
|
|
855
856
|
const allowedFormats = ["json", "msgpack", "bytes", "images", "dictionary", "string"];
|
|
856
857
|
const master_ip = "127.0.0.1";
|
|
858
|
+
var msg_type = "";
|
|
859
|
+
var timeout = 10000;
|
|
857
860
|
|
|
858
861
|
const requester = createRequester(master_ip, PORT_MASTER_INFO);
|
|
859
862
|
const results = await sendRequest(requester, { "input": "topics" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nep-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"main": "./lib/nep.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"nep": "./bin/index.js"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"nep-js": "^0.3.8",
|
|
16
16
|
"open": "7.4.2",
|
|
17
17
|
"socket.io": "^4.7.2",
|
|
18
|
-
"vue": "^2.7.16",
|
|
19
18
|
"zeromq": "6.0.0-beta.19"
|
|
20
19
|
}
|
|
21
20
|
}
|
|
21
|
+
|