Block users from running your app with root permissions
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test Use `ava` for testing (#10) Sep 23, 2017
.editorconfig
.gitattributes
.gitignore
.npmrc Bump chalk and meta tweaks Sep 23, 2017
.travis.yml
index.js
license
package.json
readme.md
screenshot.png

readme.md

sudo-block Build Status

Block users from running your app with root permissions

Install

$ npm install sudo-block

Usage

const sudoBlock = require('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

Custom message.

License

MIT © Sindre Sorhus