Check if the process is running as root user, eg. started with
sudo.
$ npm install --save is-root$ sudo node index.js// index.js
var isRoot = require('is-root');
isRoot();
//=> trueMIT © Sindre Sorhus
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Check if the process is running as root user, eg. started with
sudo.
$ npm install --save is-root$ sudo node index.js// index.js
var isRoot = require('is-root');
isRoot();
//=> trueMIT © Sindre Sorhus