Add a logAt(index, message) function to your NodeJS console.
yarn add -D consome
or
npm i -save-dev consome
require('consome');
console.logAt(0, 'logging something at line 0');
console.logAt(2, 'logging something at line 2');
Let's implement a dynamic terminal loader:
require('consome');
console.log('----- Demo -----');
const loadingLine = console.log('Loading');
setInterval(() => {
console.logAt(loadingLine, `Loading ${loader.next()}`)
}, 500);
console.log('----- Fin -----');
Unless otherwise specified this project is licensed under Apache License Version 2.0.