terminal
This is part of the ES-Git project.
Install
npm install --save @es-git/terminal
Usage
import Teminal from '@es-git/terminal';
//Create a terminal, and log to the console
const terminal = new Terminal(m => console.log(m));
//log normal text
terminal.log('ready');//ready
//carriage return (\r) will reset cursor to start of line
terminal.log('\rset\r');//set
//append newline at end of line
terminal.logLine('go!!!');//go!!!
//append just a newline
terminal.logLine();//go!!!\n
console.log(terminal.content); //go!!!