UNPKG

is-elevated

Version:

Check if the process is running with elevated privileges

8 lines (6 loc) 207 B
import process from 'node:process'; import isRoot from 'is-root'; import isAdmin from 'is-admin'; export default async function isElevated() { return process.platform === 'win32' ? isAdmin() : isRoot(); }