npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

resolve-global

2.0.0

@sindresorhus

npmHomeRepoSnykSocket
Downloads:2883028
$ npm install resolve-global
DailyWeeklyMonthlyYearly

resolve-global

Resolve the path of a globally installed module

Install

npm install resolve-global

Usage

npm install --global cat-names
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().

Related

  • import-global - Import a globally installed module
  • resolve-from - Resolve the path of a module from a given path
  • import-from - Import a module from a given path
  • is-installed-globally - Check if your package was installed globally
  • global-directory - Get the directory of globally installed packages and binaries