diff options
author | Kobayashi Shunta <[email protected]> | 2024-08-08 23:07:47 +0900 |
---|---|---|
committer | Ayke <[email protected]> | 2024-08-09 20:30:58 +0200 |
commit | 841abb0903b4873041ef8d3ef2ec497c1343f914 (patch) | |
tree | c6d72fbb271be73e86d2493056c5e516191d89c6 /targets/wasm_exec.js | |
parent | fb3d98ce6e6786f7133facbe131374102a6aa375 (diff) | |
download | tinygo-841abb0903b4873041ef8d3ef2ec497c1343f914.tar.gz tinygo-841abb0903b4873041ef8d3ef2ec497c1343f914.zip |
feat: add node: specifier
Diffstat (limited to 'targets/wasm_exec.js')
-rw-r--r-- | targets/wasm_exec.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js index a7f8c31b1..690245440 100644 --- a/targets/wasm_exec.js +++ b/targets/wasm_exec.js @@ -29,7 +29,7 @@ } if (!global.fs && global.require) { - global.fs = require("fs"); + global.fs = require("node:fs"); } const enosys = () => { @@ -101,7 +101,7 @@ } if (!global.crypto) { - const nodeCrypto = require("crypto"); + const nodeCrypto = require("node:crypto"); global.crypto = { getRandomValues(b) { nodeCrypto.randomFillSync(b); @@ -119,11 +119,11 @@ } if (!global.TextEncoder) { - global.TextEncoder = require("util").TextEncoder; + global.TextEncoder = require("node:util").TextEncoder; } if (!global.TextDecoder) { - global.TextDecoder = require("util").TextDecoder; + global.TextDecoder = require("node:util").TextDecoder; } // End of polyfills for common API. |