is-root

Check if the process is running as root user. Eg. started with `sudo`.

npm install is-root
9 068 downloads in the last day
52 872 downloads in the last week
207 624 downloads in the last month

is-root Build Status

Check if the process is running as root user. Eg. started with sudo.

Install

Install with npm

npm install --save is-root

Example

$ sudo node index.js
// index.js
var isRoot = require('is-root');

isRoot();
//=> true

License

MIT © Sindre Sorhus

npm loves you