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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guest271314/native-messaging-nodejs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "WTFPLv2",
5
5
  "exports": "./nm_nodejs.js"
6
6
  }
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
- // try {port.postMessage(Array((209715*65)))} catch (e) {console.log(e)}
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._handle.setBlocking(false);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-messaging-nodejs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Node.js Native Messaging host",
5
5
  "keywords": [
6
6
  "Native Messaging",