diff options
author | Nikolai Vavilov <vvnicholas@gmail.com> | 2020-04-30 17:00:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 10:00:02 -0400 |
commit | 84d687e958ab93afb161def4a8ab47f8994307c9 (patch) | |
tree | 748ebc9ba246b5f30dbdc37b73b638e96a3d8386 | |
parent | 46bfcbbaa84b4b715f3b829c9b4ac3b5154adfb6 (diff) |
std/node: make process global (#4985)
-rw-r--r-- | std/node/README.md | 2 | ||||
-rw-r--r-- | std/node/process.ts | 7 |
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, +}); |