node-opcua-samples 2.67.1 → 2.69.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.
|
@@ -44,7 +44,7 @@ let curNodeCompletion = [];
|
|
|
44
44
|
|
|
45
45
|
function save_endpoint_history(callback) {
|
|
46
46
|
if (endpoints_history.length > 0) {
|
|
47
|
-
fs.writeFileSync(endpoints_history_file, endpoints_history.join("\n"), "
|
|
47
|
+
fs.writeFileSync(endpoints_history_file, endpoints_history.join("\n"), "utf-8");
|
|
48
48
|
}
|
|
49
49
|
if (callback) {
|
|
50
50
|
callback();
|
|
@@ -63,7 +63,7 @@ let lines = [];
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
if (fs.existsSync(endpoints_history_file)) {
|
|
66
|
-
lines = fs.readFileSync(endpoints_history_file, "
|
|
66
|
+
lines = fs.readFileSync(endpoints_history_file, "utf-8");
|
|
67
67
|
endpoints_history = lines.split(/\r\n|\n/);
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -118,7 +118,7 @@ rl.prompt();
|
|
|
118
118
|
|
|
119
119
|
function save_history(callback) {
|
|
120
120
|
const history_uniq = _.uniq(rl.history);
|
|
121
|
-
fs.writeFileSync(history_file, history_uniq.join("\n"), "
|
|
121
|
+
fs.writeFileSync(history_file, history_uniq.join("\n"), "utf-8");
|
|
122
122
|
callback();
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -297,7 +297,7 @@ function colorize(value) {
|
|
|
297
297
|
if (rl.history) {
|
|
298
298
|
|
|
299
299
|
if (fs.existsSync(history_file)) {
|
|
300
|
-
lines = fs.readFileSync(history_file, "
|
|
300
|
+
lines = fs.readFileSync(history_file, "utf-8");
|
|
301
301
|
lines = lines.split(/\r\n|\n/);
|
|
302
302
|
}
|
|
303
303
|
if (lines.length === 0) {
|
package/bin/opcua_interceptor.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* eslint no-process-exit: 0 */
|
|
2
2
|
"use strict";
|
|
3
|
-
const argv = require("yargs")
|
|
4
|
-
.usage("Usage: $0 --portServer [num] --port [num] --hostname <hostname> -block")
|
|
5
|
-
.argv;
|
|
6
3
|
const net = require("net");
|
|
7
4
|
|
|
5
|
+
const chalk = require("chalk");
|
|
8
6
|
|
|
7
|
+
const argv = require("yargs")
|
|
8
|
+
.usage("Usage: $0 --portServer [num] --port [num] --hostname <hostname> -block")
|
|
9
|
+
.argv;
|
|
9
10
|
|
|
10
11
|
const opcua = require("node-opcua");
|
|
11
12
|
|
|
@@ -18,8 +19,6 @@ const messageHeaderToString = require("../lib/misc/message_header").messageHeade
|
|
|
18
19
|
|
|
19
20
|
const s = require("../lib/datamodel/structures");
|
|
20
21
|
|
|
21
|
-
const chalk = require("chalk");
|
|
22
|
-
|
|
23
22
|
const remote_port = parseInt(argv.port, 10) || 4841;
|
|
24
23
|
const hostname = argv.hostname || "localhost";
|
|
25
24
|
|
|
@@ -42,7 +41,7 @@ TrafficAnalyser.prototype.add = function (data) {
|
|
|
42
41
|
|
|
43
42
|
if (messageHeader.msgType === "ERR") {
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
const err = new s.TCPErrorMessage();
|
|
46
45
|
err.decode(stream);
|
|
47
46
|
console.log(" Error 0x" + err.statusCode.toString() + " reason:" + err.reason);
|
|
48
47
|
console.log(hexDump(data));
|
|
@@ -112,6 +111,7 @@ require("net").createServer(function (socket) {
|
|
|
112
111
|
try {
|
|
113
112
|
socket.write(data);
|
|
114
113
|
} catch (err) {
|
|
114
|
+
/** */
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-samples",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.69.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -samples",
|
|
5
5
|
"bin": {
|
|
6
6
|
"simple_client": "./dist/simple_client_ts.js",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"@types/yargs": "17.0.10",
|
|
21
21
|
"easy-table": "^1.2.0",
|
|
22
22
|
"exit": "^0.1.2",
|
|
23
|
-
"node-opcua": "2.
|
|
23
|
+
"node-opcua": "2.69.0",
|
|
24
24
|
"node-opcua-assert": "2.66.0",
|
|
25
25
|
"node-opcua-pki": "^2.15.4",
|
|
26
|
-
"node-opcua-server-configuration": "2.
|
|
26
|
+
"node-opcua-server-configuration": "2.69.0",
|
|
27
27
|
"sprintf-js": "^1.1.2",
|
|
28
28
|
"treeify": "^1.1.0",
|
|
29
|
-
"underscore": "^1.13.
|
|
29
|
+
"underscore": "^1.13.3",
|
|
30
30
|
"yargs": "15.4.1"
|
|
31
31
|
},
|
|
32
32
|
"author": "Etienne Rossignon",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"internet of things"
|
|
45
45
|
],
|
|
46
46
|
"homepage": "http://node-opcua.github.io/",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6c88d05e8c82ce4bc9c8af9f0a8eb6136f31d2ce"
|
|
48
48
|
}
|