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

Package detail

downgrade-root

sindresorhus720kMIT2.0.0

Try to downgrade the permissions of a process with root privileges

sudo, root, user, permissions, uid, block, prevent, stop, downgrade, drop, privileges

readme

downgrade-root

Try to downgrade the permissions of a process with root privileges

Usually applies to a process started with sudo.

Windows is gracefully ignored as it lacks a way to set UID.

Install

$ npm install downgrade-root

Usage

import downgradeRoot from 'downgrade-root';

try {
    downgradeRoot();
} catch {
    console.error('Couldn\'t downgrade permissions');
}

Tip

Useful for trying to downgrade permission before blocking using your app as root.