Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/process.ts>Process

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
class Process
extends EventEmitter
import { Process } from "https://deno.land/std@0.172.0/node/process.ts";

Constructors

new
Process()

Properties

_eval: string | undefined
_exiting
_kill
argv

https://nodejs.org/api/process.html#process_process_argv Read permissions are required in order to get the executable route

config: { target_defaults; variables; }
features: { inspector: boolean; }
hrtime

Returns the current high-resolution real time in a [seconds, nanoseconds] tuple.

Note: You need to give --allow-hrtime permission to Deno to actually get nanoseconds precision values. If you don't give 'hrtime' permission, the returned values only have milliseconds precision.

time is an optional parameter that must be the result of a previous process.hrtime() call to diff with the current time.

These times are relative to an arbitrary time in the past, and not related to the time of day and therefore not subject to clock drift. The primary use is for measuring performance between intervals. https://nodejs.org/api/process.html#process_process_hrtime_time

mainModule: any
memoryUsage
noDeprecation: boolean

Methods

addListener(event: "exit", listener: (code: number) => void): this
addListener(event: notImplementedEvents[number], listener: Function): this
emit(event: string, ...args: any[]): boolean
optional
getgid(): number

This method is removed on Windows

optional
getuid(): number

This method is removed on Windows

off(event: "exit", listener: (code: number) => void): this
off(event: notImplementedEvents[number], listener: Function): this
on(event: "exit", listener: (code: number) => void): this
on(event: notImplementedEvents[number], listener: Function): this
prependListener(event: "exit", listener: (code: number) => void): this
prependListener(event: notImplementedEvents[number], listener: Function): this
removeListener(event: "exit", listener: (code: number) => void): this
removeListener(event: notImplementedEvents[number], listener: Function): this