# is-installed-globally

> Check if your package was installed globally

Latest version **1.0.0** (published 2023-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-installed-globally
pnpm add is-installed-globally
yarn add is-installed-globally
bun add is-installed-globally
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-11-06 |
| First published | 2017-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 71 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | global, package, globally, module, install, installed, npm, yarn, is, check, detect, local, locally, cli, bin, binary |

## Links

- npm: https://www.npmjs.com/package/is-installed-globally
- Repository: https://github.com/sindresorhus/is-installed-globally
- Homepage: https://github.com/sindresorhus/is-installed-globally#readme
- Issues: https://github.com/sindresorhus/is-installed-globally/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-installed-globally

## Dependencies (2)

- [is-path-inside](https://npm.io/package/is-path-inside.md) ^4.0.0
- [global-directory](https://npm.io/package/global-directory.md) ^4.0.1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-11-06
- 0.4.0 — 2021-01-17
- 0.3.2 — 2020-04-06
- 0.3.1 — 2019-11-08
- 0.3.0 — 2019-09-18
- 0.2.0 — 2019-05-12
- 0.1.0 — 2017-06-25

## README

# 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

```sh
npm install is-installed-globally
```

## Usage

```js
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
```

## Related

- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
- [global-directory](https://github.com/sindresorhus/global-directory) - Get the directory of globally installed packages and binaries

---
_Source: https://npm.io/package/is-installed-globally · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
