is-root (2.1.0)
Published 2026-02-24 13:58:38 +00:00 by atheaadmin
Installation
registry=npm install is-root@2.1.0"is-root": "2.1.0"About this package
is-root 
Check if the process is running as root user, for example, one started with
sudo
Install
$ npm install is-root
Usage
$ sudo node index.js
// index.js
const isRoot = require('is-root');
isRoot();
//=> true
Related
- is-elevated - Check if the process is running with elevated privileges (cross-platform)
License
MIT © Sindre Sorhus
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| ava | ^1.4.1 |
| tsd | ^0.7.2 |
| xo | ^0.24.0 |
Keywords
sudo
root
user
permissions
uid
process
posix