versabin
v0.1.0
Published
A versatile binary package manager for downloading and managing executables from various sources
Maintainers
Readme
VersaBin
A versatile binary package manager for downloading and managing executables from various sources.
Features
- Download binaries from GitHub releases, URLs, Git repositories, and custom sources
- Support for multiple platforms (Windows, macOS, Linux) and architectures (x64, ARM)
- Version management for installed binaries
- Dependency resolution
- Security verification (checksum and signature verification)
- Flexible storage strategies
- Simple CLI and programmatic API
Installation
npm install -g versabinCLI Usage
Install a binary
versabin install ripgrepInstall a specific version
versabin install [email protected]List installed binaries
versabin listList available versions for a binary
versabin versions ripgrepSwitch to a different version
versabin use ripgrep 13.0.0Execute a binary
versabin exec ripgrep --versionAPI Usage
import { VersaBin } from 'versabin';
const versabin = new VersaBin();
// Install a binary
await versabin.install({
name: 'ripgrep',
source: {
type: 'github',
config: {
owner: 'BurntSushi',
repo: 'ripgrep',
assetPattern: 'ripgrep-.*-{platform}-{arch}.{ext}'
}
}
});
// Execute a binary
const result = await versabin.execute('ripgrep', ['--version']);
console.log(result.stdout);
// Get binary path
const binaryPath = versabin.getBinaryPath('ripgrep');
// List installed versions
const versions = await versabin.listVersions('ripgrep');
// Switch version
await versabin.use('ripgrep', '13.0.0');Configuration
Create a versabin.config.json file in your project or home directory:
{
"storage": {
"strategy": "user",
"symlink": true
},
"packages": [
{
"name": "ffmpeg",
"description": "A complete solution to record, convert and stream audio and video",
"source": {
"type": "github",
"config": {
"owner": "FFmpeg",
"repo": "FFmpeg",
"assetPattern": "ffmpeg-.*-{platform}-{arch}.{ext}"
}
},
"binaryPath": "bin/ffmpeg",
"platforms": ["win32", "darwin", "linux"],
"architectures": ["x64", "arm64"],
"env": {
"FFMPEG_PATH": "{binPath}"
}
}
]
}License
MIT
