FixedPosition
FixedPosition controls where an interactive component renders relative to the terminal viewport. "top" and "bottom" reserve a scroll region so the component stays pinned while normal output scrolls past it. "inline" renders at the current cursor position without any scroll-region manipulation.
Type Definition
type FixedPosition = "inline" | "top" | "bottom";
Values
"inline"— default; renders where the cursor currently is and scrolls with the rest of the output."top"— pins the component to the first row of the terminal. A scroll region is created so log output appears below it."bottom"— pins the component to the last row. Log output scrolls above it, keeping the component always visible at the bottom.
Usage
import { Progress } from "ts-better-console";
const bar = new Progress("Uploading", 100, {bar: { position: "bottom" },});
Want to support this project?
If you find ts-better-console useful and want to support its development, consider starring the GitHub repository or buying me a coffee! Your support helps me dedicate more time to improving the library and adding new features.
Want to contribute to this project?
Contributions are welcome! If you're interested in improving the library, fixing bugs, or adding new features, feel free to check out the GitHub repository and submit a pull request. Whether you're a seasoned developer or new to open source, your contributions can make a difference!