JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 282576
  • Score
    100M100P100Q177381F

Block users from running your tool with root permissions

Package Exports

  • sudo-block

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sudo-block) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sudo-block Build Status

Block users from running your tool with root permissions.

Install

Install with npm: npm install --save sudo-block

Example

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.

API

sudoBlock(options)

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 for
  • message: a custom error message

sudoBlock.isRoot

Boolean indicating whether the current user is root.

License

MIT License • © Sindre Sorhus