summaryrefslogtreecommitdiff
path: root/std/node/global.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/node/global.ts')
-rw-r--r--std/node/global.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/std/node/global.ts b/std/node/global.ts
index 3037cf23e..b102edddc 100644
--- a/std/node/global.ts
+++ b/std/node/global.ts
@@ -1,4 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+import process from "./process.ts";
+import { Buffer as buffer } from "./buffer.ts";
Object.defineProperty(globalThis, Symbol.toStringTag, {
value: "global",
@@ -10,4 +12,27 @@ Object.defineProperty(globalThis, Symbol.toStringTag, {
// deno-lint-ignore no-explicit-any
(globalThis as any)["global"] = globalThis;
+// Define the type for the global declration
+type Process = typeof process;
+type Buffer = typeof buffer;
+
+Object.defineProperty(globalThis, "process", {
+ value: process,
+ enumerable: false,
+ writable: true,
+ configurable: true,
+});
+
+declare global {
+ const process: Process;
+ const Buffer: Buffer;
+}
+
+Object.defineProperty(globalThis, "Buffer", {
+ value: buffer,
+ enumerable: false,
+ writable: true,
+ configurable: true,
+});
+
export {};