package
Resolves the full path to the bin file of a given package by inspecting the "bin" field in its package.json.
npm install resolve-binGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
20.8 kB
Includes dependencies.
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.jsnpm install resolve-binResolves the full path to the bin file of a given package by inspecting the "bin" field in its package.json.
| Name | Type | Argument | Description | |||||
|---|---|---|---|---|---|---|---|---|
name | string | module name, i.e. 'tap' | ||||||
opts | Object |
<optional> | options Properties
|
MIT
thlorenz
thlorenz10@gmail.com
(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 |
Synchronous version of resolveBin
| Name | Type | Argument | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
name | string | module name, i.e. 'tap' | |||||||
opts | Object |
<optional> | options Properties
|
generated with docme