Skip to content

Commit 841abb0

Browse files
monta-kaykevl
authored andcommitted
feat: add node: specifier
1 parent fb3d98c commit 841abb0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

targets/wasm_exec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
}
3030

3131
if (!global.fs && global.require) {
32-
global.fs = require("fs");
32+
global.fs = require("node:fs");
3333
}
3434

3535
const enosys = () => {
@@ -101,7 +101,7 @@
101101
}
102102

103103
if (!global.crypto) {
104-
const nodeCrypto = require("crypto");
104+
const nodeCrypto = require("node:crypto");
105105
global.crypto = {
106106
getRandomValues(b) {
107107
nodeCrypto.randomFillSync(b);
@@ -119,11 +119,11 @@
119119
}
120120

121121
if (!global.TextEncoder) {
122-
global.TextEncoder = require("util").TextEncoder;
122+
global.TextEncoder = require("node:util").TextEncoder;
123123
}
124124

125125
if (!global.TextDecoder) {
126-
global.TextDecoder = require("util").TextDecoder;
126+
global.TextDecoder = require("node:util").TextDecoder;
127127
}
128128

129129
// End of polyfills for common API.

0 commit comments

Comments
 (0)