check-sudo
v1.1.3
Published
Check process elevation on Linux, MacOs or Windows
Downloads
5
Maintainers
Readme
check-sudo
Check process elevation on Linux, MacOs or Windows
Install
NPM
npm i check-sudo
Yarn
yarn add check-sudo
Check Linux, Macos and Windows
import { checkSudo } from 'check-sudo'
// Promises
checkSudo().then(isSudo => console.log(isSudo))
// Await/async
(async () => {
console.log(await checkSudo())
})
Check Linux or Macos
import { checkLinuxOrMacSudo } from 'check-sudo'
// Promises
checkLinuxOrMacSudo().then(isSudo => console.log(isSudo))
// Await/async
(async () => {
console.log(await checkLinuxOrMacSudo())
})
Check Windows
import { checkWindowsSudo } from 'check-sudo'
// Promises
checkWindowsSudo().then(isSudo => console.log(isSudo))
// Await/async
(async () => {
console.log(await checkWindowsSudo())
})