# admin-check

> package to check if the script is running with admin permissions

Latest version **1.1.3** (published 2020-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install admin-check
pnpm add admin-check
yarn add admin-check
bun add admin-check
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2020-10-11 |
| First published | 2020-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/admin-check) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | denizariyan |
| Maintainers | denizariyan |
| Keywords | admin, permission, check, is admin, administrator, is, admin, if admin, windows, win32, win64, running, command-line, cmd, is admin, detect |

## Links

- npm: https://www.npmjs.com/package/admin-check
- Repository: https://github.com/denizariyan/admin-check
- Homepage: https://github.com/denizariyan/admin-check#readme
- Issues: https://github.com/denizariyan/admin-check/issues
- npm.io page: https://npm.io/package/admin-check

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2020-10-11
- 1.1.2 — 2020-10-03
- 1.1.1 — 2020-10-02
- 1.1.0 — 2020-10-02
- 1.0.1 — 2020-10-02
- 1.0.0 — 2020-10-02

## README

# Admin Check

![Version](https://img.shields.io/github/v/release/denizariyan/admin-check)
![Node.js CI](https://github.com/denizariyan/admin-check/workflows/Node.js%20CI/badge.svg)

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.

```bash
npm i admin-check
```

## Usage

Returns a `<Boolean>` which is true when admin privileges are present.
```nodejs
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](https://github.com/denizariyan/admin-check/blob/main/LICENSE.md)

---
_Source: https://npm.io/package/admin-check · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
