Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sudo-block

sindresorhus1.4mMIT5.0.0TypeScript support: included

Block users from running your app with root permissions

sudo, root, user, permissions, uid, block, prevent, stop

readme

sudo-block

Block users from running your app with root permissions

Install

npm install sudo-block

Usage

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.