Options
All
  • Public
  • Public/Protected
  • All
Menu

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())
})

Index

Functions

checkLinuxOrMacSudo

  • checkLinuxOrMacSudo(): boolean
  • Returns boolean

checkSudo

  • checkSudo(): Promise<boolean>
  • Returns Promise<boolean>

checkWindowsSudo

  • checkWindowsSudo(): Promise<boolean>
  • Returns Promise<boolean>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc