Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

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

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc