is-root

Check if the process is running as root user, for example, one started with `sudo`

MIT 5 个版本
安装
npm install is-root
yarn add is-root
pnpm add is-root
bun add is-root
README

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
  • is-elevated - Check if the process is running with elevated privileges (cross-platform)
版本列表
3.0.0 2021-04-07
2.1.0 2019-04-19
2.0.0 2018-03-22
1.0.0 2014-08-13
0.1.0 2014-02-06