npm.io
3.0.0 • Published 5 years ago

is-root

Licence
MIT
Version
3.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
79

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
import isRoot from 'is-root';

isRoot();
//=> true
  • is-elevated - Check if the process is running with elevated privileges (cross-platform)

Keywords