Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielcsapo/onwithit
🚀 a threaded progression logger
https://github.com/gabrielcsapo/onwithit
javascript logger threaded utility
Last synced: 21 days 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-22T19:54:05.000Z (almost 7 years ago)
- Last Synced: 2024-10-13T20:44:45.654Z (25 days ago)
- Topics: javascript, logger, threaded, utility
- Language: JavaScript
- Homepage: https://gabrielcsapo.github.io/onwithit
- Size: 869 KB
- Stars: 0
- Watchers: 3
- 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.
[![Build Status](https://travis-ci.org/gabrielcsapo/onwithit.svg?branch=master)](https://travis-ci.org/gabrielcsapo/onwithit)
[![Dependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/onwithit/status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/onwithit)
[![devDependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/onwithit/dev-status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/onwithit#info=devDependencies)
[![Coverage Status](https://lcov-server.gabrielcsapo.com/badge/github%2Ecom/gabrielcsapo/onwithit.svg)](https://lcov-server.gabrielcsapo.com/coverage/github%2Ecom/gabrielcsapo/onwithit)
[![npm](https://img.shields.io/npm/dt/onwithit.svg?maxAge=2592000)]()
[![npm](https://img.shields.io/npm/dm/onwithit.svg?maxAge=2592000)]()## 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.