Interactive ManagerGetting Started

Getting Started

Install and start using the interactive manager

Installation

Install the package using your preferred package manager:

pnpm add @visulima/interactive-manager
bash npm install @visulima/interactive-manager
bash yarn add @visulima/interactive-manager
bun add @visulima/interactive-manager

Basic Usage

Setting Up

The interactive manager requires two stream hooks — one for stdout and one for stderr:

import { InteractiveManager, InteractiveStreamHook } from "@visulima/interactive-manager";

const stdoutHook = new InteractiveStreamHook(process.stdout);
const stderrHook = new InteractiveStreamHook(process.stderr);
const manager = new InteractiveManager(stdoutHook, stderrHook);

Updating Output

Once hooked, you can dynamically update terminal output:

manager.hook();

// Write multiple lines
manager.update("stdout", ["Line 1", "Line 2", "Line 3"]);

// Update with new content (previous lines are erased)
manager.update("stdout", ["Updated line 1", "Updated line 2"]);

manager.unhook();

Suspend and Resume

Temporarily pause interactive mode to allow external output:

manager.hook();
manager.update("stdout", ["Processing..."]);

// Pause interactive mode
manager.suspend("stdout");
console.log("This message appears normally");

// Resume interactive mode
manager.resume("stdout");
manager.update("stdout", ["Still processing..."]);

manager.unhook();

See Also

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues