tinybrowser
v0.0.17
Published
Tiny headless browser binary for Playwright, CDP, and WebDriver.
Readme
tinybrowser
The npm launcher for the native tinybrowser
binary. npm installs the matching @tinybrowser/cli-<platform> optional
dependency for your operating system and CPU, so the binary is ready to run
with no build step.
Usage
To run without installing:
npx tinybrowser --help
npx tinybrowser daemon startTo install globally, run:
npm install -g tinybrowser
tinybrowser --helpWhen the matching optional dependency is installed, tinybrowser runs the
bundled native binary directly. It hands over stdin, stdout, stderr, and the
exit status with no network download.
When optional dependencies are disabled (--no-optional), when
TINYBROWSER_VERSION selects another version, or when Termux reports Linux,
the launcher downloads the GitHub Release archive instead. It checks the
archive SHA-256 against the release sha256sums.txt, caches the binary
locally, and then runs it. Later runs reuse the cached binary.
Platforms
| Platform | Target triple | Package |
| ---------------------- | ---------------------------- | -------------------------------- |
| Linux x64 | x86_64-unknown-linux-musl | @tinybrowser/cli-linux-x64 |
| macOS arm64 | aarch64-apple-darwin | @tinybrowser/cli-darwin-arm64 |
| Windows x64 | x86_64-pc-windows-msvc | @tinybrowser/cli-win32-x64 |
| Android / Termux arm64 | aarch64-linux-android | @tinybrowser/cli-android-arm64 |
On any other platform, the launcher fails with a clear error and a link to build from source.
Environment overrides
| Variable | Effect |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| TINYBROWSER_VERSION | Release tag to download, with or without the leading v. Overrides the optional dependency when it differs from the package version. |
| TINYBROWSER_BINARY | Run this local binary instead of the optional dependency or the cached download. |
| XDG_CACHE_HOME | Cache root for the fallback download on Linux and macOS. Default: ~/.cache. |
| LOCALAPPDATA | Cache root for the fallback download on Windows. Default: the OS temp directory. |
The fallback cache stores binaries under
$XDG_CACHE_HOME/tinybrowser/v<version>/<target>/tinybrowser, or the Windows
equivalent under %LOCALAPPDATA%\tinybrowser. Download and extraction are
atomic, so concurrent npx tinybrowser runs cannot corrupt the cache.
WebAssembly
This package is the native CLI only. For Node, Workers, or browser Wasm, use
@tinybrowser/wasm.
Source pointers
| Need | Source |
| --- | --- |
| Optional package resolution, release fallback, SHA-256 verification, and spawn logic | packages/cli/bin/tinybrowser.mjs |
| Platform package staging and optionalDependencies packing | packages/cli/scripts/pack-cli.mjs |
| Target detection and cache path rules | packages/cli/bin/lib.mjs |
| All CLI subcommands, flags, and exit codes | src/cli.rs (or run tinybrowser --help) |
| Full project documentation | tinybrowser.ericc.ch/#documentation |
License and credits
MIT. See LICENSE, NOTICE, and CREDITS.md.
