kevva / bin-wrapper

Binary wrapper that makes your programs seamlessly available as local dependencies
MIT License
152 stars 65 forks source link

feat: Support for local files #84

Open vHeemstra opened 1 year ago

vHeemstra commented 1 year ago

Support for copying local binaries before trying the downloads.

Works the same as .src(), except url is a local filepath. Bin-wrapper now tries the localSrcs first (copying them in place when found) and falls back to downloading srcs on fail.

Reason

Downloading binaries slows down CI scripts significantly and a lot of the packages using bin-wrapper ship with binaries which have already been downloaded and can be used.

Changes

vHeemstra commented 1 year ago

Note: Travis CI test fail, because current xo and ava are different from originally used ones. To solve this, this would need the PRs updating the code base to be merged.

bjesuiter commented 1 year ago

@vHeemstra This is cool, bc. I need a similar thing. I'm behind corporate firewalls and using this bin-wrapper with network access ragens from 'pain' to 'impossible'. So I'm constantly wrapping binaries I need in npm packages and deploying them to npm.

I've one question regarding your code: Do you really need to copy the dependency? Since I want to use it with the binaries distributed inside the same package, I would not need them to be copied, as this would only increase the size of my already big package.

What I want to create are basically "offline-installers", where everything is contained in the npm package. (Since these would be cached on our corporate internal Nexus package manager) :D