1.0.0 • Published 8 years ago

globalrequire v1.0.0

Weekly downloads
2
License
BSD-2-Clause
Repository
github
Last release
8 years ago

globalrequire NPM version Dependency Status

require() globally installed modules

globalrequire is like require but for globally installed modules. Supports both yarn and npm's global locations, with a preference for yarn when in conflict. Will not attempt to do any fallback to local modules or NODE_PATH.

Installation

$ npm i --save globalrequire

Example

const globalrequire = require('globalrequire');

console.log(globalrequire('npm').version);
//=> '3.10.9'

console.log(globalrequire.resolve('npm'));
//=> '/Users/silverwind/.npm-global/lib/node_modules/npm'

API

globalrequire(module)

globalrequire.resolve(module)

  • module String - The module name. Will throw on invalid module names or relative requests.

© silverwind, distributed under BSD licence

1.0.0

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago