New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

witch

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

witch

require.resolve for binaries

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
2
Created
Source

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

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.


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.

Keywords

require

FAQs

Package last updated on 20 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts