From 84d687e958ab93afb161def4a8ab47f8994307c9 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Thu, 30 Apr 2020 17:00:02 +0300 Subject: std/node: make process global (#4985) --- std/node/README.md | 2 +- std/node/process.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'std/node') 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, +}); -- cgit v1.2.3