is-root
Check if the process is running as root user, eg. started with `sudo`.
Last updated 10 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-root 
SYNC missed versions from official npm registry.

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)

Current Tags

  • 3.0.0                                ...           latest (4 years ago)

5 Versions

  • 3.0.0                                ...           4 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           7 years ago
  • 1.0.0                                ...           10 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 7
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE