resolve-bin
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/resolve-bin package

    1.0.0 • Public • Published

    resolve-bin build status

    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:
    Name Type Argument Description
    name string

    module name, i.e. 'tap'

    opts Object <optional>

    options

    Properties
    Name Type Description
    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:
    Name Type Argument Description
    name string

    module name, i.e. 'tap'

    opts Object <optional>

    options

    Properties
    Name Type Description
    executable string

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

    Source:

    generated with docme

    License

    MIT

    Install

    npm i resolve-bin

    DownloadsWeekly Downloads

    38,580

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    16.1 kB

    Total Files

    15

    Last publish

    Collaborators

    • bendrucker
    • thlorenz