Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

animate-tty

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

animate-tty

Animate things like progress bars on the tty

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

usage

var animator = require('animate-tty')([opts, ]animateFn)

After animator.start() the string returned by animateFn is updated to the terminal repeatedly.

The parameter runtime is passed to animateFn with the time in milliseconds elapsed since animator.start().

opts

  • stream The stream the output to, defaults to process.stdout
  • interval The frame length in milliseconds, defaults to 100

animator.start()

Start the animation.

animator.stop(keep)

Stop the animation.

  • keep If set to true, it will keep the last print

animator.log(str)

Permanently logs str before the animation similar to console.log normally, but makes sure it doesn't break the animation.

example

var animator = require('animate-tty')(function (runtime) {
  return 'Elapsed: '+ Math.floor(runtime / 1000) +' s\n'+ 'Data: ' + Math.random()
})

animator.start()

Also see and run example.js.

Keywords

FAQs

Package last updated on 10 Dec 2014

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