JSPM

  • Created
  • Published
  • Downloads 777348
  • Score
    100M100P100Q175831F
  • License MIT

Binary wrapper for Node.js that makes your programs seamlessly available as local dependencies

Package Exports

  • bin-wrapper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bin-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bin-wrapper Build Status

Getting started

Install with npm: npm install bin-wrapper

Examples

All platform and arch specific options takes precedence over the base options. See test.js for a full fleshed example.

var Bin = require('bin-wrapper');

var opts = {
    name: 'Gifsicle',
    bin: 'gifsicle',
    path: __dirname + '/vendor',
    url: 'http://url/to/gifsicle',
    platform: {
        win32: {
            bin: 'gifsicle.exe',
            url: [
                'http://url/to/gifsicle.exe'
                'http://url/to/gifsicle.dll'
            ]
        }
    }
}

var bin = new Bin(opts)

bin.check('--version', function (works) {
    if (works) {
        console.log('Binary downloaded and passed the test!')
    }
});

Get the path to your binary with bin.path.

console.log(bin.path);
// => path/to/vendor/gifsicle

API

.check(cmd, cb)

Check if a binary is present and working. If it isn't, download and test it by running the binary with cmd and see if it exits correctly.

License

MIT License (c) Kevin Mårtensson