diff --git a/node/process.ts b/node/process.ts index 1c9db0fc92b8..a1f58db9c35c 100644 --- a/node/process.ts +++ b/node/process.ts @@ -391,6 +391,11 @@ class Process extends EventEmitter { // TODO(kt3k): Implement this when we added -e option to node compat mode _eval: string | undefined = undefined; + + /** https://nodejs.org/api/process.html#processexecpath */ + get execPath() { + return argv[0]; + } } /** https://nodejs.org/api/process.html#process_process */ diff --git a/node/process_test.ts b/node/process_test.ts index 4491d8a421a3..d7bf2c2ffa06 100644 --- a/node/process_test.ts +++ b/node/process_test.ts @@ -408,3 +408,7 @@ Deno.test("process.config", () => { Deno.test("process._exiting", () => { assert(process._exiting === false); }); + +Deno.test("process.execPath", () => { + assertEquals(process.execPath, process.argv[0]); +});