is-root

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

npm install is-root
9 145 downloads in the last day
46 346 downloads in the last week
212 093 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