1 | # is-root
|
2 |
|
3 | > Check if the process is running as root user, for example, one started with `sudo`
|
4 |
|
5 | ## Install
|
6 |
|
7 | ```
|
8 | $ npm install is-root
|
9 | ```
|
10 |
|
11 | ## Usage
|
12 |
|
13 | ```
|
14 | $ sudo node index.js
|
15 | ```
|
16 |
|
17 | ```js
|
18 | // index.js
|
19 | import isRoot from 'is-root';
|
20 |
|
21 | isRoot();
|
22 | //=> true
|
23 | ```
|
24 |
|
25 | ## Related
|
26 |
|
27 | - [is-elevated](https://github.com/sindresorhus/is-elevated) - Check if the process is running with elevated privileges *(cross-platform)*
|