https://github.com/gabrielcsapo/onwithit
🚀 a threaded progression logger
https://github.com/gabrielcsapo/onwithit
javascript logger threaded utility
Last synced: 2 months ago
JSON representation
🚀 a threaded progression logger
- Host: GitHub
- URL: https://github.com/gabrielcsapo/onwithit
- Owner: gabrielcsapo
- License: apache-2.0
- Created: 2018-01-19T22:35:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-22T19:54:05.000Z (over 7 years ago)
- Last Synced: 2025-03-15T01:53:29.173Z (2 months ago)
- Topics: javascript, logger, threaded, utility
- Language: JavaScript
- Homepage: https://gabrielcsapo.github.io/onwithit
- Size: 869 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
[](https://travis-ci.org/gabrielcsapo/onwithit)
[](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/onwithit)
[](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/onwithit#info=devDependencies)
[](https://lcov-server.gabrielcsapo.com/coverage/github%2Ecom/gabrielcsapo/onwithit)
[]()
[]()## Installation
```
npm install onwithit --save
```## Usage
```js
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](https://github.com/sindresorhus/ora) is a great library and has been used in a ton of my projects.