native-messaging-nodejs 0.1.0 → 0.1.1
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/deno.json +1 -1
- package/nm_nodejs.js +5 -2
- package/package.json +1 -1
package/deno.json
CHANGED
package/nm_nodejs.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Node.js Native Messaging host
|
|
3
3
|
// guest271314, 10-9-2022
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// /home/user/bin/deno -A --v8-flags="--expose-gc" --unstable-bare-node-builtins
|
|
6
|
+
// /home/user/bin/bun --expose-gc
|
|
7
|
+
|
|
8
|
+
// try {port.postMessage(Array((209715*65)))}catch(e){console.log(e)}
|
|
6
9
|
// Error: Message exceeded maximum allowed size of 64MiB.
|
|
7
10
|
// import fs from "node:fs";
|
|
8
11
|
const maxMessageLengthFromHost = 209715;
|
|
@@ -11,7 +14,7 @@ const encoder = new TextEncoder();
|
|
|
11
14
|
const decoder = new TextDecoder();
|
|
12
15
|
const data = Array();
|
|
13
16
|
// https://github.com/nodejs/node/issues/11568#issuecomment-282765300
|
|
14
|
-
process.stdout
|
|
17
|
+
process.stdout?._handle?.setBlocking(false);
|
|
15
18
|
|
|
16
19
|
for await (const nativeMessage of process.stdin) {
|
|
17
20
|
if (currentMessageLength === 0 && data.length === 0) {
|