# witch

> require.resolve for binaries

Latest version **1.0.3** (published 2017-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install witch
pnpm add witch
yarn add witch
bun add witch
```

## 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.0.3 |
| Published | 2017-07-20 |
| First published | 2015-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Leonard Martin |
| Maintainers | lennym, a-z |
| Keywords | require, resolve, binary, path |

## Links

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

## Dependencies (2)

- [findup](https://npm.io/package/findup.md) ^0.1.5
- [callsite](https://npm.io/package/callsite.md) ^1.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2017-07-20
- 1.0.2 — 2017-05-31
- 1.0.1 — 2017-03-20
- 1.0.0 — 2016-11-07
- 0.0.0 — 2015-10-19

## README

# witch
require.resolve for binaries

Given the name of a locally installed dependency, witch will return the paths to the module's associated binary scripts.

## Example

```javascript
const witch = require('witch');
witch('gulp');

// returns "/Users/lennym/dev/my-project/node_modules/gulp/bin/gulp.js"
```

For modules which include more than one binary script, you can pass a specific binary name as a second parameter.

```javascript

const witch = require('witch');
witch('mocha', '_mocha');

// returns "/Users/lennym/dev/my-project/node_modules/mocha/bin/_mocha"
```

## FAQs

### Aren't all my installed binaries symlinked into `./node_modules/.bin` anyway?

No. This only applies to the top-level module. If you're writing code that might ever be installed as a child dependency then you should not assume the install paths of dependencies.

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