0.2.0 • Published 4 years ago
stdout-line v0.2.0
stdout-line
Yet another function to log by overwriting previous output.
Differences:
- Single line enforced
- Trims or pads the line to fit the stdout width.
- This ensures the next log (by other methods:
console.log) automatically prints to (apparently) next line since the previous line had been fully padded.
- This ensures the next log (by other methods:
- Small, no dependencies
Install
npm install stdout-lineUsage
import line from 'stdout-line'
line('this will get replaced by')
line('next line')line.persist('unless persisted')API
import { create } from 'stdout-line'
create(opts)opts.stream[=process.stdout]Stream to write toopts.width[number=stream.columns|80]Widthopts.join[string= ]Join ...message array withopts.throttle[number]Throttle logging (ms)opts.format[function]Format message before writing tostream