Skip to content

[PUBLIC] Spawn a child process with admin privileges

License

Notifications You must be signed in to change notification settings

PaletteGear/spawn-as-admin

 
 

Repository files navigation

spawn-as-admin

Run commands with administrator privileges

Installing

npm install spawn-as-admin

Docs

spawnAsAdmin(command, arguments)

Launches a new process with the given command, and arguments.

Returns an AdminProcess object that implements a subset of node's ChildProcess API:

Properties:

  • pid - The child process's process ID.
  • stdin - A WritableStream representing the process's standard input.
  • stdout - A ReadableStream representing the process's standard output.

Methods:

  • kill([signal]) - Sends the given signal to the child process. If no signal is specified, SIGTERM will be sent.

Events:

  • exit - Emitted when the process exits, and passes the exit code of the process.

Limitations

  • The library only works on macOS and Windows.
  • The stdin and stdout properties are only present on macOS.

About

[PUBLIC] Spawn a child process with admin privileges

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 61.0%
  • JavaScript 31.5%
  • Python 7.5%