# yarn-global

> A set of useful methods for @yarnpkg

Latest version **1.2.0** (published 2020-05-15) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2020-05-15 |
| First published | 2017-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | EGOIST |
| Maintainers | rem |
| Keywords | yarn |

## Links

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

## Dependencies (1)

- [user-home](https://npm.io/package/user-home.md) ^2.0.0

## Recent versions

- 1.2.0 (latest) — 2020-05-15
- 1.1.0 — 2017-02-23
- 1.0.2 — 2017-02-23
- 1.0.1 — 2017-02-23
- 1.0.0 — 2017-02-23

## README

# yarn-global

[![NPM version](https://img.shields.io/npm/v/yarn-global.svg?style=flat-square)](https://npmjs.com/package/yarn-global) [![NPM downloads](https://img.shields.io/npm/dm/yarn-global.svg?style=flat-square)](https://npmjs.com/package/yarn-global) [![Build Status](https://img.shields.io/circleci/project/egoist/yarn-global/master.svg?style=flat-square)](https://circleci.com/gh/egoist/yarn-global)

## Install

```bash
yarn add yarn-global
```

## Usage

```js
const yarnGlobal = require('yarn-global')

yarnGlobal.getDirectory()
//=> /Users/name/.config/yarn/global/node_modules

yarnGlobal.inDirectory(process.cwd())
// Check if a path is a child path of the value of `yarnGlobal.getDirectory()`

yarnGlobal.getDependencies()
// An array of denpendencies installed by `yarn global add`

yarnGlobal.hasDependency('create-react-app')
// Check if you have installed it via `yarn global add`
//=> true

yarnGlobal.hasPackage('minimist')
// Check if `/Users/name/.config/yarn/global/node_modules/minimist` exists
// you may not have installed it by `yarn global add`
//=> true
```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

[MIT](https://egoist.mit-license.org/) © [EGOIST](https://github.com/egoist)

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