cli-html
Version:
Render HTML to Terminal
18 lines (14 loc) • 364 B
JavaScript
import chalk from 'chalk';
const {
grey,
} = chalk;
const hrLine = (inputHrString, length) => {
const lengthHr = length || process.stdout.columns;
return Array.from({ length: lengthHr }).join(inputHrString);
};
export const hr = (tag, context) => ({
marginTop: 1,
value: grey(hrLine('─', context.lineWidth)),
marginBottom: 1,
type: 'block',
});