npm.io
1.0.5 • Published 4 years ago

is-win32-admin

Licence
MIT
Version
1.0.5
Deps
0
Size
16 kB
Vulns
0
Weekly
0
Stars
1

Win32 Admin Check

is-win32-admin is an NPM package to check if node is running on an admin elevated win32 platform (Windows).

Installation

NPM:

npm i is-win32-admin

yarn:

yarn add is-win32-admin

Usage

This returns Promise<boolean> which is true if the process is running as an admin and throws an error if the device is not running on windows

import isAdmin from "is-win32-admin";

isAdmin()
  .then((admin) => {
    if (admin) {
      //... do admin stuff
    }
  })
  .catch((err) => {
    // errors out when not running on win32
  });

Contributing

Feel free to make a pull request

License

MIT