cronvel / terminal-kit

Terminal utilities for node.js
MIT License
3.08k stars 198 forks source link

How to add text before a spinner #217

Open kernelwernel opened 1 year ago

kernelwernel commented 1 year ago

So, I essentially want to add something before the spinner, like this:

┌─[ (spinner animation) Loading modules...
└──> Done!

I know how to edit the second line but I just can't figure out a way to put something behind the animation. This is what I tried:

console.log("┌─[ ") 
var spinner = await term.spinner('dotSpinner');
console.log("Loading modules...");
psulek commented 1 year ago

@Existential-Kernel you need to use term instead of console.log, for your situation use:

await term('┌─[ ').spinner('dotSpinner');
term(' Loading modules...');
// some work here...
term('\n└──> Done!');