@cjser/downgrade-root
v2.0.0-cjser.2
Published
Try to downgrade the permissions of a process with root privileges
Maintainers
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-rootUsage
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.
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/downgrade-root
