Socket
Socket
Sign inDemoInstall

resolve-bin

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve-bin

Resolves the full path to the bin file of a given package by inspecting the "bin" field in its package.json.


Version published
Weekly downloads
63K
increased by5.21%
Maintainers
2
Weekly downloads
 
Created
Source

resolve-bin Tests

Resolves the full path to the bin file of a given package by inspecting the "bin" field in its package.json.

var resolveBin = require('resolve-bin');

// package.json: "bin": "bin/tap.js"
resolveBin('tap', function (err, bin) {
  if (err) return console.error(err);
  console.log(bin);  
});

// => [..]/resolve-bin/node_modules/tap/bin/tap.js

Installation

npm install resolve-bin

API

resolveBin(name, opts, cb)

Resolves the full path to the bin file of a given package by inspecting the "bin" field in its package.json.

Parameters:
NameTypeArgumentDescription
name string

module name, i.e. 'tap'

opts Object <optional>

options

Properties
NameTypeDescription
executable string

(default: @name) executable name (e.g. 'buster-test')

cb function

called back with the full path to the bin file of the module or an error if it couldn't be resolved

Source:
resolveBin::sync(name, opts) → {string}

Synchronous version of resolveBin

Parameters:
NameTypeArgumentDescription
name string

module name, i.e. 'tap'

opts Object <optional>

options

Properties
NameTypeDescription
executable string

(default: @name) executable name (e.g. 'buster-test')

Source:

generated with docme

License

MIT

Keywords

FAQs

Package last updated on 20 May 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc