resolve-global
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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().

/resolve-global/

    Package Sidebar

    Install

    npm i resolve-global

    Weekly Downloads

    2,157,213

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    4.84 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus