Block users from running your tool with root permissions.
Install with npm: npm install --save sudo-block
var sudoBlock = require('sudo-block');
sudoBlock('my-module');When the above file is ran 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.
Options is either a string specifying the package name or an object with these keys:
packageName: name of the package the error message is printed formessage: a custom error message
Boolean indicating whether the current user is root.
MIT License • © Sindre Sorhus
