0.0.2 • Published 6 years ago

onwithit v0.0.2

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
6 years ago

onwithit

🚀 a threaded progression logger

The purpose of onwithit is to be able to make logging to the stdout threaded. The current logging approach is dependent on the main thread which will make updating animations or text being displayed to the user seem stalled. The simplest of all animations is a loading or spinner animation that the user could encounter during a long running task.

Build Status Dependency Status devDependency Status Coverage Status npm npm

Installation

npm install onwithit --save

Usage

function wait(time) {
  var now = Date.now();
  while(Date.now() < now + time){}
}
const OnWithIt = require('onwithit');

const program = new OnWithIt("Building something cool").start();
wait(500);
program.text = "Building phase 1";
wait(500);
program.info("Phase 1 built");
program.text = "Building phase 2";
wait(500);
program.success("Phase 2 built");
program.stop();

Thanks

The interface for onwithit has taken cues from the greats, ora is a great library and has been used in a ton of my projects.