resolve-global
Resolve the path of a globally installed module
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install resolve-global 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

2 Versions

  • 1.0.0                                ...           6 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |