-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
deno-env-shim.js
28 lines (27 loc) · 945 Bytes
/
deno-env-shim.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Buffer as __nodeBuffer } from "node:buffer";
import {
clearImmediate as __nodeClearImmediate,
clearInterval as __nodeClearInterval,
clearTimeout as __nodeClearTimeout,
setImmediate as __nodeSetImmediate,
setInterval as __nodeSetInterval,
setTimeout as __nodeSetTimeout,
} from "node:timers";
import __nodeConsole from "node:console";
import __nodeProcess from "node:process";
import { performance as __nodePerformance } from "node:perf_hooks";
import { createRequire as __nodeCreateRequire } from "node:module";
Object.assign(globalThis, {
global: globalThis,
Buffer: __nodeBuffer,
clearImmediate: __nodeClearImmediate,
clearInterval: __nodeClearInterval,
clearTimeout: __nodeClearTimeout,
setImmediate: __nodeSetImmediate,
setInterval: __nodeSetInterval,
setTimeout: __nodeSetTimeout,
console: __nodeConsole,
process: __nodeProcess,
performance: __nodePerformance,
require: __nodeCreateRequire(import.meta.url),
});