president
v2.0.4
Published
Execute commands with privileges!
Downloads
294
Maintainers
Readme
president
Execute commands with privileges!
Run commands with administrator privileges in Windows and UNIX based operating systems.
var president = require('president');
president.execute([ 'dmesg' ], function(error) {
if(error) throw error;
console.log(stdout);
});
$ node example.js
Password:
(dmesg output)
Installation
Install president
by running:
$ npm install --save president
Documentation
president.execute(Array command, Function callback)
Execute a command. The callback takes one argument: (error)
.
If president
runs in Windows, windosu is used, otherwise the command is prefixed with sudo
.
Tests
Run the test suite by doing:
$ gulp test
Contribute
- Issue Tracker: github.com/jviotti/president/issues
- Source Code: github.com/jviotti/president
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
Support
If you're having any problem, please raise an issue on GitHub.
License
The project is licensed under the MIT license.