Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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, for example, one started with `sudo`

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.6M
increased by3.63%
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 07 Apr 2021

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