# global-npm

> Require global npm as a local node module.

Latest version **0.5.0** (published 2021-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install global-npm
pnpm add global-npm
yarn add global-npm
bun add global-npm
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2021-10-24 |
| First published | 2015-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/global-npm) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | dracupid |
| Maintainers | dracupid |

## Links

- npm: https://www.npmjs.com/package/global-npm
- Repository: https://github.com/dracupid/global-npm
- Homepage: https://github.com/dracupid/global-npm#readme
- Issues: https://github.com/dracupid/global-npm/issues
- npm.io page: https://npm.io/package/global-npm

## Dependencies (1)

- [which](https://npm.io/package/which.md) latest

## Recent versions

- 0.5.0 (latest) — 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

## README

global-npm
======
Require global npm as a local node module.

[![NPM version](https://badge.fury.io/js/global-npm.svg)](https://www.npmjs.com/package/global-npm)
[![Deps](https://david-dm.org/dracupid/global-npm.svg?style=flat)](https://david-dm.org/dracupid/global-npm)
[![Build Status](https://travis-ci.org/dracupid/global-npm.svg)](https://travis-ci.org/dracupid/global-npm)
[![Build status](https://ci.appveyor.com/api/projects/status/github/dracupid/global-npm?svg=true)](https://ci.appveyor.com/project/dracupid/global-npm)

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

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:

0. [set `NODE_PATH` environment variable](https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders) to the folder where global modules are installed.
0. [link](https://docs.npmjs.com/cli/link) the local project with global module to use.
0. [require a file path](https://nodejs.org/api/modules.html#modules_file_modules) 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
```javascript
var npm = require('global-npm')
```

**If the version of npm counts, please use [semver](https://github.com/npm/node-semver) to check `npm.version` by yourself.**

## License
MIT@Dracupid

---
_Source: https://npm.io/package/global-npm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
