Socket
Socket
Sign inDemoInstall

is-installed-globally

Package Overview
Dependencies
3
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

is-installed-globally

Check if your package was installed globally

    1.0.0latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
11,756,414
increased by1.86%

Weekly downloads

Package description

What is is-installed-globally?

The `is-installed-globally` package is a simple utility that allows developers to check if a given npm package is installed globally on the system. This can be particularly useful for CLI tools or libraries that need to adjust their behavior based on whether they're running in a global context.

What are is-installed-globally's main functionalities?

Check if a package is installed globally

This feature allows developers to programmatically determine if the current package is installed globally. It returns a boolean value: `true` if the package is installed globally, and `false` otherwise. This can be useful for CLI applications that may have different behaviors or configurations when installed globally versus locally.

const isInstalledGlobally = require('is-installed-globally');

console.log(isInstalledGlobally); // true or false

Other packages similar to is-installed-globally

Readme

Source

is-installed-globally

Check if your package was installed globally

Can be useful if your CLI needs different behavior when installed globally and locally.

Install

npm install is-installed-globally

Usage

import isInstalledGlobally from 'is-installed-globally';

// With `npm install your-package`
console.log(isInstalledGlobally);
//=> false

// With `npm install --global your-package`
console.log(isInstalledGlobally);
//=> true
  • import-global - Import a globally installed module
  • resolve-global - Resolve the path of a globally installed module
  • global-directory - Get the directory of globally installed packages and binaries

Keywords

FAQs

Last updated on 06 Nov 2023

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc