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

    1.0.0 • Public • Published

    resolve-global Build Status

    Resolve the path of a globally installed module

    Install

    $ npm install resolve-global
    

    Usage

    $ npm install --global cat-names
    
    const resolveGlobal = require('resolve-global');
     
    console.log(resolveGlobal('cat-names'));
    //=> '/usr/local/lib/node_modules/cat-names'

    API

    resolveGlobal(moduleId)

    Throws if the module can't be found.

    resolveGlobal.silent(moduleId)

    Returns undefined instead of throwing if the module can't be found.

    moduleId

    Type: string

    What you would use in require().

    Related

    License

    MIT © Sindre Sorhus

    Install

    npm i resolve-global

    DownloadsWeekly Downloads

    1,617,937

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.34 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus