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

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

Related

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

License

MIT © Sindre Sorhus

Current Tags

  • 2.1.0                                ...           latest (a year ago)

4 Versions

  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 6,684
This Week 22,017
This Month 43,814
Last Day 8,043
Last Week 34,289
Last Month 142,889
Dependencies (0)
None
Dev Dependencies (3)
Dependents (318)

Copyright 2014 - 2016 © taobao.org |