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,525
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    3,525
  • 2.1.0
    12,290,428
  • 2.0.0
    559,838
  • 1.0.0
    1,109,258
  • 0.1.0
    1,360

Package Sidebar

Install

npm i is-root

Weekly Downloads

4,245,255

Version

3.0.0

License

MIT

Unpacked Size

2.59 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus