npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bin-manager

v1.3.1

Published

Binary wrapper that makes your programs seamlessly available as local dependencies

Downloads

14

Readme

NodeJS Binary Manager Travis CI Codecov npm npm version

🌀 Binaries available as local nodeJS dependencies

Install

$ npm install --save bin-manager

Usage

const bmanager = require('bin-manager');

const base = 'https://github.com/imagemin/gifsicle-bin/raw/master/vendor';
const bin = bmanager('bin', 'gifsicle')
  .src(base + '/macos/gifsicle', 'darwin')
  .src(base + '/linux/x64/gifsicle', 'linux', 'x64')
  .src(base + '/win/x64/gifsicle.exe', 'win32', 'x64')
  .use(process.platform === 'win32' ? 'gifsicle.exe' : 'gifsicle');

bin.run(['--version'], (err, out) => {
  if (err) {
    console.log(error);
    return;
  }
  console.log(out.stdout);
});

API

bmanager(dist, slug)

Creates a new bmanager instance.

dist

Type: string Default: ''

Accepts a path where the binaries will be stored to.

slug

Type: string Default: ''

Accepts an unique slug for the binary. The binary will be downloaded inside the path: dist/slug

.src([url], [os], [arch])

Adds a source to download. If 0 arguments are passed, the array of current setted sources is returned.

url

Type: string

Accepts a URL pointing to a file to download.

os

Type: string

Tie the source to a specific OS.

arch

Type: string

Tie the source to a specific arch.

.dest(destination)

Adds a destination folder.

destination

Type: string

The path which the files will be downloaded to.

.use([binary])

Get or set the binary path of the extracted file.

binary

Type: string

Define which file to use as executable. If undefined the current setted value is returned.

.path()

Returns the full path where the binary will downloaded to.

.bin()

Returns the full path to your binary.

.remote()

Returns the URLs that will be used/was used to download the binaries for your platform.

.load([options], callback)

Runs the search for the binary. If no binary is found it will download it using the URL provided in .src(). It usese download under the hood. See here all available options.

options

Type: Object Default: {extract: true}

callback(err)

Type: Function

.unload([options], callback)

Removes downloaded binaries, if presents. It usese del under the hood. See here all available options.

options

Type: Object Default: {}

callback(err)

Type: Function

.run([arguments], [options], callback)

Runs the binary. If the binary is not loaded it will also load it. It usese execa under the hood. See here all available options.

arguments

Type: Array Default: []

options

Type: Object Default: {}

callback(err, out)

Type: Function

Returns a possible error and the output object.

Authors

See also the list of contributors who participated in this project.

Heavily inspired from bin-wrapper

License

This project is licensed under the MIT License - see the LICENSE file for details.