admin-check
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/admin-check package

1.1.3 • Public • Published

Admin Check

Version Node.js CI

Admin Check is an NPM package to check if the current script is running with admin privileges.

Currently only available for Windows. It uses a native Windows command("net session") that is only available with admin privileges to check if the admin privileges are present.

Installation

Use the package manager NPM to install Admin Check.

npm i admin-check

Usage

Returns a <Boolean> which is true when admin privileges are present.

const admin = require("admin-check");
 
admin.check().then(result => {
  if (result) {
    // Do something when admin privileges are present
  } else {
    // Do something when admin privileges are NOT present
  }
});

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

/admin-check/

    Package Sidebar

    Install

    npm i admin-check

    Weekly Downloads

    28

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    4.71 kB

    Total Files

    6

    Last publish

    Collaborators

    • denizariyan