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)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    3,077
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    3,077
  • 2.1.0
    9,530,034
  • 2.0.0
    412,661
  • 1.0.0
    868,195
  • 0.1.0
    1,103

Package Sidebar

Install

npm i is-root

Weekly Downloads

4,234,704

Version

3.0.0

License

MIT

Unpacked Size

2.59 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus