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 Build Status

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
  • 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
Details
npm
2026-02-24 13:58:38 +00:00
1
Sindre Sorhus
MIT
latest
1.5 KiB
Assets (1)
Versions (1) View all
2.1.0 2026-02-24