Run commands with administrator privileges
npm install spawn-as-admin
Launches a new process with the given command
, and arguments
.
Returns an AdminProcess
object that implements a subset of node's ChildProcess
API:
pid
- The child process's process ID.stdin
- AWritableStream
representing the process's standard input.stdout
- AReadableStream
representing the process's standard output.
kill([signal])
- Sends the givensignal
to the child process. If no signal is specified,SIGTERM
will be sent.
exit
- Emitted when the process exits, and passes the exit code of the process.
- The library only works on macOS and Windows.
- The
stdin
andstdout
properties are only present on macOS.