summaryrefslogtreecommitdiff
path: root/std/node
diff options
context:
space:
mode:
Diffstat (limited to 'std/node')
-rw-r--r--std/node/README.md2
-rw-r--r--std/node/process.ts7
2 files changed, 8 insertions, 1 deletions
diff --git a/std/node/README.md b/std/node/README.md
index bbd168825..8d5dc5567 100644
--- a/std/node/README.md
+++ b/std/node/README.md
@@ -69,7 +69,7 @@ they are stable:
## CommonJS Module Loading
`createRequire(...)` is provided to create a `require` function for loading CJS
-modules.
+modules. It also sets supported globals.
```ts
import { createRequire } from "https://deno.land/std/node/module.ts";
diff --git a/std/node/process.ts b/std/node/process.ts
index f90e1eada..f4bdd8686 100644
--- a/std/node/process.ts
+++ b/std/node/process.ts
@@ -37,3 +37,10 @@ export const process = {
return [Deno.execPath(), ...Deno.args];
},
};
+
+Object.defineProperty(globalThis, "process", {
+ value: process,
+ enumerable: false,
+ writable: true,
+ configurable: true,
+});