JavaScript wrapper for the merobox CLI tool. This package automatically downloads the appropriate merobox binary for your platform and provides both CLI access and a programmatic API.
npm install @calimero-network/merobox-js
After installation, you can use merobox directly from the command line:
npx @calimero-network/merobox-js --version
npx @calimero-network/merobox-js health
npx @calimero-network/merobox-js list
import { ensureMerobox, runMerobox, getMeroboxVersion } from '@calimero-network/merobox-js';
// Ensure merobox is available
const binPath = await ensureMerobox();
console.log('merobox binary at:', binPath);
// Run merobox commands
await runMerobox(['health']);
await runMerobox(['list']);
// Get version
const version = await getMeroboxVersion();
console.log('merobox version:', version);
import { test } from '@playwright/test';
import { ensureMerobox, runMerobox } from '@calimero-network/merobox-js';
test.beforeAll(async () => {
await ensureMerobox();
await runMerobox(['run']);
});
test.afterAll(async () => {
await runMerobox(['stop', '--all']);
});
test('e2e test', async ({ page }) => {
await page.goto('http://localhost:3000');
// ... your test code
});
Ensures merobox is available and working. Returns the path to the merobox binary.
Runs merobox with the given arguments.
Options:
cwd?: string
- Working directoryenv?: NodeJS.ProcessEnv
- Environment variablesstdio?: 'inherit' | 'pipe' | 'ignore'
- Standard I/O handlingtimeout?: number
- Execution timeout
Returns the version of the installed merobox binary.
Checks if merobox is available without throwing an error.
Returns the path to the merobox binary (synchronous).
- macOS: x64, arm64
- Linux: x64, arm64
Note: Windows is not currently supported by merobox releases.
- During
npm install
, the postinstall script detects your platform - Downloads the appropriate merobox binary from GitHub Releases
- Verifies the binary using SHA256 checksums
- Places the binary in
node_modules/@calimero/merobox/bin/
- Creates a CLI shim for direct command-line access
MEROBOX_VERSION
: Override the merobox version to download (default: v0.1.27)
If you get "merobox binary not found", try:
npm install @calimero-network/merobox-js --force
This package supports the platforms listed above. If you're on an unsupported platform, you may need to build merobox from source.
If the binary download fails checksum verification, the postinstall script will fail. This usually indicates a corrupted download or a problem with the release assets.
# Install dependencies
npm install
# Build TypeScript
npm run build
# Test the package
npm test
MIT