All Projects → derrickpelletier → Node Status

derrickpelletier / Node Status

Licence: mit
Nodejs stdout status and progress bar. Multi-item, various display types.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Status

angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-63.38%)
Mutual labels:  progress, progress-bar
Qier Progress
💃 Look at me, I am a slim progress bar and very colorful / 支持彩色或单色的顶部进度条
Stars: ✭ 307 (+332.39%)
Mutual labels:  progress, progress-bar
LineProgressbar
A light weight jquery progressbar plugin
Stars: ✭ 34 (-52.11%)
Mutual labels:  progress, progress-bar
GradientProgress
A gradient progress bar (UIProgressView).
Stars: ✭ 38 (-46.48%)
Mutual labels:  progress, progress-bar
Python Progressbar
Progressbar 2 - A progress bar for Python 2 and Python 3 - "pip install progressbar2"
Stars: ✭ 682 (+860.56%)
Mutual labels:  progress, progress-bar
mp-progress
专注于小程序圆环形进度条的小工具
Stars: ✭ 72 (+1.41%)
Mutual labels:  progress, progress-bar
Topbar
Tiny & beautiful site-wide progress indicator
Stars: ✭ 262 (+269.01%)
Mutual labels:  progress, progress-bar
react-sweet-progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 250 (+252.11%)
Mutual labels:  progress, progress-bar
Multiprogressview
📊 An animatable view that depicts multiple progresses over time. Modeled after UIProgressView
Stars: ✭ 614 (+764.79%)
Mutual labels:  progress, progress-bar
Ng2 Slim Loading Bar
Angular 2 component shows slim loading bar at the top of the page.
Stars: ✭ 376 (+429.58%)
Mutual labels:  progress, progress-bar
CustomProgress
自定义水平带百分比数字的进度条以及自定义圆形带百分比数字的进度条
Stars: ✭ 58 (-18.31%)
Mutual labels:  progress, progress-bar
Vue Step Progress
A simple Vue component that displays a Progress Bar with labels for each step
Stars: ✭ 26 (-63.38%)
Mutual labels:  progress, progress-bar
ProBar
this script will allow you to configure a progress bar with a timer with other options
Stars: ✭ 0 (-100%)
Mutual labels:  progress, progress-bar
DottedProgressBar
Simple and powerful animated progress bar with dots
Stars: ✭ 40 (-43.66%)
Mutual labels:  progress, progress-bar
tox-progress
This JavaScript library was made to easily create animated radial progress bars.
Stars: ✭ 13 (-81.69%)
Mutual labels:  progress, progress-bar
VHProgressBar
Vartical and Horizontal ProgressBar
Stars: ✭ 23 (-67.61%)
Mutual labels:  progress, progress-bar
React Sweet Progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 239 (+236.62%)
Mutual labels:  progress, progress-bar
CustomProgress
一款常见的进度条加载框架
Stars: ✭ 32 (-54.93%)
Mutual labels:  progress, progress-bar
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+28959.15%)
Mutual labels:  progress, progress-bar
Roundprogresstextview
TextView with Round Pogress
Stars: ✭ 18 (-74.65%)
Mutual labels:  progress, progress-bar

node-status

Makes a little stdout status bar. As simple or complex as you need.

npm install node-status

Example of custom patterns

image

Example of steps

image

Quickstart

var status = require('node-status')
var pizzas = status.addItem('pizza')

status.start()

pizzas.inc()
pizzas.inc(3)

Config

Status accepts the following config options on start():

  • invert: defaults to false. Inverts the colors of the bar.
  • interval: defaults to 250. Number of milliseconds per re-draw interval.
  • pattern: optional manual definition for status bar layout. See Patterns
status.start({
	invert: true,
	interval: 200,
	pattern: 'Doing work: {uptime}  |  {spinner.cyan}  |  {pizza.bar}'
})

Item Options

All item options are optional.

option type default notes
count number 0 Can specify a starting count if needed.
max number null Will cause 'count' type to display as count/max. Required for some display types. Can be a number or a function that returns a number.
custom function null a function run when the pattern {<item>.custom} is used. Access this.count and this.max for values if needed. Must return a string.
precision number 2 The precision used in percentages.
steps Array false An array of strings that identify steps for the item. The count of the item identifies the current step.

Item Methods

method notes
inc( Number ) Increases the count on the item by the desired amount. If no amount is specified, will increase by 1.
dec( Number ) Decreases the count on the item by the desired amount. If no amount is specified, will decrease by 1.
doneStep( success:Boolean, message:String ) A helper method for when using steps on an item. Will stamp the step to the screen with a ✔ when success is true, ✖ when false. An optional message can be added which will be appended to the display. See the gif above, or the examples/steps.js

Patterns

The pattern setting in status config can be used to layout your bar as you see fit, if the default doesn't suit you. Simply a string of tokens.

The pattern:

'Doing work: {uptime}  |  {spinner.cyan}  |  {pizza.bar}'

Would render as:

Doing work: 10s  |  ⠼  |  [▒▒▒▒▒▒----]

Tokens are specified as: {<token>[.color][.modifier]}.

All tokens support colorization with marak/colors.

Non-item tokens

token modifiers notes
uptime renders the current uptime of the process.
spinner spinner types renders a spinner. Any type available in cli-spinners can be used. Ex: {spinner.bouncingBall.cyan}

Item tokens

All items use their name as tokens. If you add an item named pizza, you can render it in the pattern with {pizza}. Simple.

Item type modifiers

The items have a number of types available to render.

type example
default 5 or 5/10 With no type specified, item is rendered as the count, or the count/max if max was specified.
percentage 15.23% Renders a simple percentage, requires max to be set. Uses the precision setting to round the value.
custom anything Renders whatever is returned by the specified custom function.
bar [▒▒▒▒▒-----] Renders as a progress bar. Requires max to be set.
time 15s Uses the count as milliseconds and renders the value as a nicely formatted time.

Using Console.log alongside status

Right now, if you have to use console.log after the status bar has started, it can be a bit janky because the stdout line isn't cleared when a console.log is run.

You can utilize an extended console.log by adding this after requiring status.

console = status.console()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].