is-root
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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

Related

  • is-elevated - Check if the process is running with elevated privileges (cross-platform)

Package Sidebar

Install

npm i is-root

Weekly Downloads

4,807,174

Version

3.0.0

License

MIT

Unpacked Size

2.59 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus