president

Execute commands with privileges!

Usage no npm install needed!

<script type="module">
  import president from 'https://cdn.skypack.dev/president';
</script>

README

president

npm version dependencies Build Status Build status

Cristina Kirchner, President of Argentina

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

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.