global-npm

Require global npm as a local node module.

MIT 8 个版本
安装
npm install global-npm
yarn add global-npm
pnpm add global-npm
bun add global-npm
README

global-npm

Require global npm as a local node module.

NPM version Deps Build Status Build status

js-standard-style

Npm is about 25MB in size now, which is quite a heavy dependency for most modules. Luckily, nearly every node.js user has a npm installed globally.

However, normally, you can't require a global module directly, unless:

  1. set NODE_PATH environment variable to the folder where global modules are installed.
  2. link the local project with global module to use.
  3. require a file path instead of a module name.

The last one should be the best way for a third-party module.

If your module needs to depend on npm, why not just use the global one?

Usage

var npm = require('global-npm')

If the version of npm counts, please use semver to check npm.version by yourself.

License

MIT@Dracupid

版本列表
0.5.0 2021-10-24
0.4.1 2020-03-22
0.4.0 2019-09-30
0.3.0 2016-01-12
0.2.0 2015-10-26
0.1.2 2015-07-27
0.1.1 2015-05-23
0.1.0 2015-05-16