Socket
Socket
Sign inDemoInstall

is-installed-globally

Package Overview
Dependencies
3
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-installed-globally

Check if your package was installed globally


Version published
Maintainers
1
Weekly downloads
10,677,502
decreased by-8.51%

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

const isInstalledGlobally = require('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-dirs - Get the directory of globally installed packages and binaries

Keywords

FAQs

Last updated on 17 Jan 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc