3.1.1 • Published 9 years ago
runas v3.1.1
Runas
Run command synchronously with administrator privilege.
Installing
npm install runas
Building
- Clone the repository
- Run
npm install
- Run
grunt
to compile the native and CoffeeScript code - Run
grunt test
to run the specs
Docs
runas = require 'runas'
runas(command, args, options)
options
Objecthide
Boolean - Hide the console window,true
by default.admin
Boolean - Run command as administrator,false
by default.catchOutput
Boolean - Catch the stdout and stderr of the command,false
by default.stdin
String - String which would be passed as stdin input.
Launches a new process with the given command
, with command line arguments in
args
.
This function is synchronous and returns the exit code when the command
finished.
When the catchOutput
option is specified to true
, an object that contains
exitCode
, stdout
and stderr
will be returned.
Limitations
- The
admin
option has only been implemented on Windows and OS X. - The
stdin
option has only been implemented on POSIX systems. - The
hide
option is only meaningful on Windows. - When
catchOutput
istrue
,- on Linux
exitCode
,stdout
andstderr
will be returned, - on OS X
- if
admin
isfalse
,exitCode
,stdout
andstderr
will be returned, - if
admin
istrue
,exitCode
andstdout
will be returned,
- if
- on Windows only
exitCode
will be returned.
- on Linux
3.1.1
9 years ago
3.1.0
9 years ago
3.0.0
9 years ago
2.0.0
9 years ago
1.2.0
9 years ago
1.1.0
9 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.6.1
10 years ago
0.6.0
10 years ago
0.5.4
10 years ago
0.5.3
10 years ago
0.5.2
10 years ago
0.5.1
10 years ago
0.5.0
10 years ago
0.4.0
10 years ago
0.3.0
10 years ago
0.2.0
11 years ago
0.1.0
11 years ago