# sudo-block

> Block users from running your app with root permissions

Latest version **5.0.0** (published 2023-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install sudo-block
pnpm add sudo-block
yarn add sudo-block
bun add sudo-block
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2023-08-31 |
| First published | 2013-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 3 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 96 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | sudo, root, user, permissions, uid, block, prevent, stop |

## Links

- npm: https://www.npmjs.com/package/sudo-block
- Repository: https://github.com/sindresorhus/sudo-block
- Homepage: https://github.com/sindresorhus/sudo-block#readme
- Issues: https://github.com/sindresorhus/sudo-block/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/sudo-block

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^5.3.0
- [is-root](https://npm.io/package/is-root.md) ^3.0.0
- [is-docker](https://npm.io/package/is-docker.md) ^3.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2023-08-31
- 4.0.0 — 2021-05-03
- 3.0.0 — 2019-04-19
- 2.0.0 — 2017-09-23
- 1.2.0 — 2015-04-08
- 1.1.1 — 2015-02-24
- 1.1.0 — 2015-01-07
- 1.0.0 — 2014-08-13
- 0.4.0 — 2014-03-06
- 0.3.0 — 2013-11-17
- 0.2.1 — 2013-08-03
- 0.2.0 — 2013-07-28
- 0.1.0 — 2013-06-26
- 0.0.0 — 2013-06-23

## README

# sudo-block

> Block users from running your app with root permissions

<img src="screenshot.png" width="660">

## Install

```sh
npm install sudo-block
```

## Usage

```js
import sudoBlock from 'sudo-block';

sudoBlock();
```

## API

### sudoBlock(message?)

When a file containing this function is run with root permissions it will exit and show an error message telling the user how to fix the problem, so they don't have to run it with `sudo`.

#### message

Type: `string`

A custom message.

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