Terminal utilities
$ npm install @absolunet/terminal
import { terminal } from '@absolunet/terminal';
terminal.setTheme({
logo: '🍭',
textColor: terminal.basicColor.magenta,
backgroundColor: '#cc00cc',
textOnBackgroundColor: terminal.basicColor.white,
spinnerColor: terminal.basicColor.magenta
});
terminal
.titleBox('Start');
.startSpinner('Checking dependencies')
;
terminal.process.runAsync('npm outdated', { silent:true }).then(({ stdout }) => {
terminal.stopSpinner();
if (stdout) {
terminal
.spacer();
.failure('Please update your project')
;
} else {
terminal.success('You are up to date!');
}
terminal.completionBox();
});
// Extend it
import { Terminal, Process } from '@absolunet/terminal';
class MyBetterTerminal extends Terminal {
}
class MyBetterProcess extends Process {
}
View documentation
MIT © Absolunet