Socket
Socket
Sign inDemoInstall

is-root

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-root

Check if the process is running as root user, eg. started with `sudo`.


Version published
Weekly downloads
3.6M
decreased by-15.68%
Maintainers
1
Weekly downloads
 
Created

What is is-root?

The is-root npm package is a simple utility that allows you to check if your Node.js process is running as the root user (also known as the superuser). This can be useful for ensuring that certain actions that require elevated privileges are not performed without the appropriate permissions.

What are is-root's main functionalities?

Check if the process is running as root

This feature allows you to determine if the current Node.js process is running with root privileges. The function returns a boolean value: true if the process is root, false otherwise.

const isRoot = require('is-root');

if (isRoot()) {
  console.log('The process is running as root.');
} else {
  console.log('The process is not running as root.');
}

Other packages similar to is-root

Keywords

FAQs

Package last updated on 13 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc