# resolve-global

> Resolve the path of a globally installed module

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

## Install

```sh
npm install resolve-global
pnpm add resolve-global
yarn add resolve-global
bun add resolve-global
```

## 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 | 2.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 | 1 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 43 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | resolve, global, package, module, globally, path, npm, yarn, packages, require |

## Links

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

## Dependencies (1)

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

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2023-11-06
- 1.0.0 — 2019-04-15
- 0.1.0 — 2017-06-25

## README

# resolve-global

> Resolve the path of a globally installed module

## Install

```sh
npm install resolve-global
```

## Usage

```sh
npm install --global cat-names
```

```js
import {resolveGlobal} from 'resolve-global';

console.log(resolveGlobal('cat-names'));
//=> '/usr/local/lib/node_modules/cat-names'
```

## API

### resolveGlobal(moduleName)

Throws if the module cannot be found.

### resolveGlobalSilent(moduleName)

Returns `undefined` instead of throwing if the module cannot be found.

#### moduleName

Type: `string`

What you would use in [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).

## Related

- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
- [is-installed-globally](https://github.com/sindresorhus/is-installed-globally) - Check if your package was installed globally
- [global-directory](https://github.com/sindresorhus/global-directory) - Get the directory of globally installed packages and binaries

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