Socket
Book a DemoInstallSign in
Socket

terminal-overwrite

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terminal-overwrite

Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc.

2.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

terminal-overwrite

Build Status

Log by overwriting the previous output in the terminal.
Useful for rendering progress bars, animations, etc.
Forked from log-update

Install

$ npm install --save terminal-overwrite

Usage

const terminalOverwrite = require('terminal-overwrite');
const frames = ['-', '\\', '|', '/'];
let i = 0;

setInterval(() => {
	const frame = frames[i = ++i % frames.length];

	terminalOverwrite(
`
        ♥♥
   ${frame} unicorns ${frame}
        ♥♥
`
	);
}, 80);

API

terminalOverwrite(text, ...)

Log to stdout.

terminalOverwrite.clear()

Clear the logged output.

terminalOverwrite.done()

Persist the logged output.
Useful if you want to start a new log session below the current one.

terminalOverwrite.stderr(text, ...)

Log to stderr.

terminalOverwrite.stderr.clear()

terminalOverwrite.stderr.done()

terminalOverwrite.create(stream)

Get a terminalOverwrite method that logs to the specified stream.

License

Keywords

log

FAQs

Package last updated on 21 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.