NidiumProcess

Object providing various information and interfaces to interact with system process.

It is not possible to create an instance of this class. 'global.process' is already available.

console.log(JSON.stringify(process));

exit()

Attach a javascript callback to a signal.

getOwner()

Return an object with information about the owner of the process.

Returns: Object

Object with details about the owner

  • uid (Integer): User ID
  • gid (Integer): Group ID
  • user (String): User name
  • group (String): Group name

setOwner(user[, group])

Set a user (and optional a group) to a process.

The setOwner function is permitted if the effective user/group name is that of the super user, or if the specified user/group name is the same as the effective user/group name.

On failure this function throws an exception.

Arguments:
user

(String | Integer): User whom should run this process

group

(String | Integer): Group whom should run this process

setSignalHandler(cb)

Attach a javascript callback to a signal.

Arguments:
cb (Function)

function to start if the process receives a signal

cwd() (static)

Get the current working directory.

Returns: String

The current path

argv(readonly)

  • Type: Object

The arguments that were set upon construction.

console.log(JSON.stringify(process));

workerId(readonly)

  • Type: Integer

The identifier for the current worker.

console.log(JSON.stringify(process));

Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!