{"id":17498391,"url":"https://github.com/simonepri/bin-manager","last_synced_at":"2025-04-28T16:10:16.310Z","repository":{"id":57189637,"uuid":"96696349","full_name":"simonepri/bin-manager","owner":"simonepri","description":"🌀 Binaries available as local nodeJS dependencies","archived":false,"fork":false,"pushed_at":"2018-01-08T13:29:25.000Z","size":502,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-21T17:38:26.301Z","etag":null,"topics":["bin-dep","bin-dependency","bin-packing","bin-wrapper","binary-manager","binary-wrapper","node","node-binary"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonepri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-09T16:20:55.000Z","updated_at":"2024-04-16T17:02:15.000Z","dependencies_parsed_at":"2022-09-15T07:01:27.880Z","dependency_job_id":null,"html_url":"https://github.com/simonepri/bin-manager","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fbin-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fbin-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fbin-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fbin-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonepri","download_url":"https://codeload.github.com/simonepri/bin-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250834205,"owners_count":21494929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bin-dep","bin-dependency","bin-packing","bin-wrapper","binary-manager","binary-wrapper","node","node-binary"],"created_at":"2024-10-19T16:55:35.138Z","updated_at":"2025-04-28T16:10:16.293Z","avatar_url":"https://github.com/simonepri.png","language":"JavaScript","readme":"# NodeJS Binary Manager [![Travis CI](https://travis-ci.org/simonepri/bin-manager.svg?branch=master)](https://travis-ci.org/simonepri/bin-manager) [![Codecov](https://img.shields.io/codecov/c/github/simonepri/bin-manager/master.svg)](https://codecov.io/gh/simonepri/bin-manager) [![npm](https://img.shields.io/npm/dm/bin-manager.svg)](https://www.npmjs.com/package/bin-manager) [![npm version](https://img.shields.io/npm/v/bin-manager.svg)](https://www.npmjs.com/package/bin-manager)\n\u003e 🌀 Binaries available as local nodeJS dependencies\n\n\n## Install\n\n```\n$ npm install --save bin-manager\n```\n\n\n## Usage\n\n```js\nconst bmanager = require('bin-manager');\n\nconst base = 'https://github.com/imagemin/gifsicle-bin/raw/master/vendor';\nconst bin = bmanager('bin', 'gifsicle')\n  .src(base + '/macos/gifsicle', 'darwin')\n  .src(base + '/linux/x64/gifsicle', 'linux', 'x64')\n  .src(base + '/win/x64/gifsicle.exe', 'win32', 'x64')\n  .use(process.platform === 'win32' ? 'gifsicle.exe' : 'gifsicle');\n\nbin.run(['--version'], (err, out) =\u003e {\n  if (err) {\n    console.log(error);\n    return;\n  }\n  console.log(out.stdout);\n});\n```\n\n## API\n\n### bmanager(dist, slug)\n\nCreates a new `bmanager` instance.\n\n##### dist\n\nType: `string`\u003cbr\u003e\nDefault: `''`\n\nAccepts a path where the binaries will be stored to.\n\n##### slug\n\nType: `string`\u003cbr\u003e\nDefault: `''`\n\nAccepts an unique slug for the binary.\u003cbr\u003e\nThe binary will be downloaded inside the path: `dist/slug`\n\n### .src([url], [os], [arch])\n\nAdds a source to download.\nIf 0 arguments are passed, the array of current setted sources is returned.\n\n#### url\n\nType: `string`\n\nAccepts a URL pointing to a file to download.\n\n#### os\n\nType: `string`\n\nTie the source to a specific OS.\n\n#### arch\n\nType: `string`\n\nTie the source to a specific arch.\n\n### .dest(destination)\n\nAdds a destination folder.\n\n#### destination\n\nType: `string`\n\nThe path which the files will be downloaded to.\n\n### .use([binary])\n\nGet or set the binary path of the extracted file.\n\n#### binary\n\nType: `string`\n\nDefine which file to use as executable.\nIf undefined the current setted value is returned.\n\n### .path()\n\nReturns the full path where the binary will downloaded to.\n\n### .bin()\n\nReturns the full path to your binary.\n\n### .remote()\n\nReturns the URLs that will be used/was used to download the binaries for your platform.\n\n### .load([options], callback)\n\nRuns the search for the binary. If no binary is found it will download it\nusing the URL provided in `.src()`.\n\u003cbr\u003eIt usese [download](https://github.com/kevva/download) under the hood.\n\u003cbr\u003eSee [here](https://github.com/kevva/download#options) all available options.\n\n#### options\n\nType: `Object`\u003cbr\u003e\nDefault: `{extract: true}`\n\n#### callback(err)\n\nType: `Function`\n\n### .unload([options], callback)\n\nRemoves downloaded binaries, if presents.\n\u003cbr\u003eIt usese [del](https://github.com/sindresorhus/del) under the hood.\n\u003cbr\u003eSee [here](https://github.com/sindresorhus/del#options) all available options.\n\n#### options\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\n#### callback(err)\n\nType: `Function`\n\n### .run([arguments], [options], callback)\n\nRuns the binary. If the binary is not loaded it will also load it.\n\u003cbr\u003eIt usese [execa](https://github.com/sindresorhus/execa) under the hood.\n\u003cbr\u003eSee [here](https://github.com/sindresorhus/execa#options) all available options.\n\n#### arguments\n\nType: `Array`\u003cbr\u003e\nDefault: `[]`\n\n#### options\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\n#### callback(err, out)\n\nType: `Function`\n\nReturns a possible error and the output object.\n\n\n## Authors\n* **Simone Primarosa** - [simonepri](https://github.com/simonepri)\n\nSee also the list of [contributors](https://github.com/simonepri/bin-manager/contributors) who participated in this project.\n\nHeavily inspired from [bin-wrapper](https://github.com/kevva/bin-wrapper)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fbin-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonepri%2Fbin-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fbin-manager/lists"}