Install the native binary system-wide and use it as a pipe monitor:
One-line install
curl -fsSL https://raw.githubusercontent.com/GeneWang1226/tqdmoon/main/scripts/install.sh | sh
Then run it from anywhere:
seq 1 100000 | tqdmoon
Install to a custom prefix (e.g. ~/.local):
curl -fsSL https://raw.githubusercontent.com/GeneWang1226/tqdmoon/main/scripts/install.sh | INSTALL_DIR=$HOME/.local sh
Install a specific release version:
curl -fsSL https://raw.githubusercontent.com/GeneWang1226/tqdmoon/main/scripts/install.sh | VERSION=v0.2.0 sh
Dev builds: The installer downloads from GitHub Releases. If no release exists yet, download the artifact from the latest successful GitHub Actions run instead.
The package installs the native binary to /usr/local/bin/tqdmoon and the WebAssembly bytecode to /usr/local/lib/tqdmoon.wasm.
WebAssembly Demo
Run the compiled tqdmoon.wasm directly in a browser.
First build the wasm target from the tqdmoon/ module directory:
cd tqdmoon
moon build --target wasm --release
cp _build/wasm/release/build/cmd/wasm/wasm.wasm ../web/tqdmoon.wasm
Then serve the web/ directory:
cd ../web
python -m http.server 8000
Open http://localhost:8000. The page loads the WebAssembly module, provides a minimal WASI shim for stdout and timers, and renders the progress bar in real time.
You can also deploy the web/ directory to any static host (GitHub Pages, Vercel, etc.) after copying the .wasm file.
Fallback Mode (without total)
for x in @tqdmoon.tqdm([10, 20, 30].iter()) {
ignore(x)
}
Output: 3 items [00:00, 405405.4 items/s]
Description & Unit
// Prefix description + custom unit
for x in @tqdmoon.tqdm(items, total=Some(100), desc="Loading", unit="B") {
ignore(x)
}
tqdmoon
中文文档
Features
Iter[T]in; counting, rendering, and terminal flushing are all automaticupdate()orrender()descprefix and customizableunit(default"items") for count and rate labelsBarStyleImport
Using
moon add(Recommended)Manual Import
Add to your
moon.pkg:Quick Start
Basic Usage (with total)
Output:
|████████████████████| 100% 9000000/9000000 [00:00<00:00, 21801311.5 items/s]Prebuilt CLI
Install the native binary system-wide and use it as a pipe monitor:
One-line install
Then run it from anywhere:
Install to a custom prefix (e.g.
~/.local):Install a specific release version:
CLI options
Available flags:
-s, --styleclassic,ascii,moon,googleclassic-d, --descPiping-u, --unitlinesInstall from .deb (Ubuntu/Debian)
The package installs the native binary to
/usr/local/bin/tqdmoonand the WebAssembly bytecode to/usr/local/lib/tqdmoon.wasm.WebAssembly Demo
Run the compiled
tqdmoon.wasmdirectly in a browser.First build the wasm target from the
tqdmoon/module directory:Then serve the
web/directory:Open http://localhost:8000. The page loads the WebAssembly module, provides a minimal WASI shim for stdout and timers, and renders the progress bar in real time.
You can also deploy the
web/directory to any static host (GitHub Pages, Vercel, etc.) after copying the.wasmfile.Fallback Mode (without total)
Output:
3 items [00:00, 405405.4 items/s]Description & Unit
Output:
Loading: |██████████ | 50% 50/100 [00:01<00:01, 50 B/s]Skins
Four built-in presets:
Preview:
tqdmoon_classic|████████░░░░░░░░░░░░| 50% 5/10tqdmoon_ascii[=====> ] 25%tqdmoon_moon|🌕🌕🌕🌕🌕🌑🌑🌑🌑🌑| 50%tqdmoon_googletqdmooooooooooooooooooooon 100%Custom Skin
Construct a
BarStyleto customize appearance:API
BarStyle
leftStringrightStringfillStringheadStringtailStringemptyStringwidthIntis_prefixBooltqdmoon_google)Testing
Run from the
tqdmoon/package directory:Directory Structure