# president

> Execute commands with privileges!

Latest version **2.0.4** (published 2017-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install president
pnpm add president
yarn add president
bun add president
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2017-08-07 |
| First published | 2015-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | Juan Cruz Viotti |
| Maintainers | jviotti |
| Keywords | president, execute, command, sudo, admin, root |

## Links

- npm: https://www.npmjs.com/package/president
- Repository: https://github.com/jviotti/president
- Issues: https://github.com/jviotti/president/issues
- npm.io page: https://npm.io/package/president

## Dependencies (4)

- [lodash](https://npm.io/package/lodash.md) ^3.6.0
- [rindle](https://npm.io/package/rindle.md) ^1.0.0
- [windosu](https://npm.io/package/windosu.md) ^0.2.0
- [underscore.string](https://npm.io/package/underscore.string.md) ^3.2.2

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.0.4 (latest) — 2017-08-07
- 2.0.3 — 2015-11-30
- 2.0.2 — 2015-11-16
- 2.0.1 — 2015-11-12
- 2.0.0 — 2015-10-26
- 1.0.0 — 2015-04-01

## README

president
---------

[![npm version](https://badge.fury.io/js/president.svg)](http://badge.fury.io/js/president)
[![dependencies](https://david-dm.org/jviotti/president.png)](https://david-dm.org/jviotti/president.png)
[![Build Status](https://travis-ci.org/jviotti/president.svg?branch=master)](https://travis-ci.org/jviotti/president)
[![Build status](https://ci.appveyor.com/api/projects/status/euen4he2h90d4sqw?svg=true)](https://ci.appveyor.com/project/jviotti/president)

![Cristina Kirchner, President of Argentina](https://raw.githubusercontent.com/jviotti/president/master/images/cristina-kirchner.jpg)

Execute commands with privileges!

Run commands with administrator privileges in Windows and UNIX based operating systems.

```javascript
var president = require('president');

president.execute([ 'dmesg' ], function(error) {
	if(error) throw error;
	console.log(stdout);
});
```

***

```sh
$ node example.js
Password:
(dmesg output)
```

Installation
------------

Install `president` by running:

```sh
$ 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](https://github.com/tehsenaus/windosu) is used, otherwise the command is prefixed with `sudo`.

Tests
-----

Run the test suite by doing:

```sh
$ gulp test
```

Contribute
----------

- Issue Tracker: [github.com/jviotti/president/issues](https://github.com/jviotti/president/issues)
- Source Code: [github.com/jviotti/president](https://github.com/jviotti/president)

Before submitting a PR, please make sure that you include tests, and that [coffeelint](http://www.coffeelint.org/) runs without any warning:

```sh
$ gulp lint
```

Support
-------

If you're having any problem, please [raise an issue](https://github.com/jviotti/president/issues/new) on GitHub.

License
-------

The project is licensed under the MIT license.

---
_Source: https://npm.io/package/president · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
