Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

atom/spawn-as-admin

Repository files navigation

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

spawn-as-admin

CI

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.