npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

log-progress

v1.0.5

Published

A simple, flexible, and highly configurable progress bar plugin.

Downloads

545

Readme

log-progress

theajack

一个简单,灵活且高度可配置的进度条插件。

A simple, flexible, and highly configurable progress bar plugin.

可以选择进度自动走动或手动走动

You can choose to move automatically or manually.

1.安装 Install
2.使用 Usage
[2.1.引入 Import](#2.1 引入-Import)
[2.2.配置 Configuration](#2.2 配置-Configuration)
[2.3.自动 Automatically](#2.3 使用进度自动走动)
[2.4.手动 Manually](#2.4 手动调整进度条)
[2.5.complete & fail](#2.5 使用complete和fail方法)
[2.6.oncomplete](#2.6 使用oncomplete属性)
3.API 列表 API List
[3.1.方法 method](#3.1 方法列表:)
[3.2.配置属性 Configuration](#3.2 配置属性列表:)

1.安装-Install

npm install log-progress

2.使用-Usage

2.1 引入-Import

2.2 配置-Configuration

2.3 使用进度自动走动

当使用默认配置,或设置 auto=true时,会启动一个自己走动的进度条
当使用auto=true时,参数time表示走动的间隔时间,参数add表示每次走动的值

2.3 Using the progress automatically

When using the default configuration, or setting auto=true, a self-propelled progress bar will be launched.
When using auto=true, the parameter time indicates the interval between moves, and the parameter add indicates the value of each walk.
效果图如下
The effect chart is as follows

progress

2.4 手动调整进度条

当设置 auto=false 时,进入手动模式,进度条不会自己走动,需要调用setValue() 方法手动调整进度条
当设置 auto=false 时,time参数和add参数不起作用。

2.4 Manually adjusting the progress bar

When setting auto=false, enter manual mode, the progress bar will not move by itself, you need to call the setValue() method to manually adjust the progress bar.
When setting auto=false, the time parameter and the add parameter do not work.
效果图如下
The effect chart is as follows

progress

2.5 使用complete和fail方法

使用complete方法可以提前成功完成进度
使用fail方法当进度无法完成时以失败的结果结束进度

2.5 Using the complete and fail methods

Using the complete method, you can successfully complete the progress in advance.
Using the fail method to end the progress with a failed result when the progress cannot be completed
complete 效果
complete effect

progress

fail 效果
fail effect

progress

2.6 使用oncomplete属性

使用oncomplete可以在进度条完成后触发一些操作

2.6 Using the oncomplete attribute

Use oncomplete to trigger some actions after the progress bar is completed.
oncomplete 效果
oncomplete effect

progress

3.Api 列表

3.1 方法列表:

3.Api list

3.1 method list:

中文:

| 方法 | 参数 | 返回值 |描述| | :------: | :------: | :------: |:------:| | config() | [object] | -- |配置一些基础信息| | start() | [object] | -- |初始化或启动progress| | pause() | -- | -- |初始化或启动progress| |complete()|[string]|--|完成一个进度| |fail()|[string]|--|以失败结束一个进度| |setTitle()|string|--|设置标题| |setTime()|number|--|设置进度条走动的间隔时间| |setValue()|number[,string]|number|设置进度条的值,返回进度条的值第二个参数是info,详情见3.2| |getValue()|--|number|获取进度条的值| |addValue()|number[,string]|number|增加进度条的值,返回进度条的值第二个参数是info,详情见3.2| |setTotal()|number|--|设置进度条的最大值| |getTotal()|--|number|获取进度条的最大值| |getPercent()|--|number|获取进度条百分比| |setInfo()|string|--|设置进度条的显示信息| |isInit()|--|boolean|获取进度条是否已经初始化| |isPause()|--|boolean|获取进度条是否处于暂停状态| |isCompleted()|--|boolean|获取进度是否已经完成|

English:

| method | arguments | return |description| | :------: | :------: | :------: |:------:| | config() | [object] | -- |Configure some basic information| | start() | [object] | -- |Initialize or start progress| | pause() | -- | -- |Initialize or start progress| |complete()|[string]|--|Complete a progress| |fail()|[string]|--|End a progress with failure| |setTitle()|string|--|Set Title| |setTime()|number|--|Set the interval at which the progress bar moves | |setValue()|number[,string]|number|Set the value of the progress bar, return the value of the progress barThe second parameter is info, see 3.2 | |getValue()|--|number|Get the value of the progress bar| |addValue()|number[,string]|number|Increase the value of the progress bar, return the value of the progress barThe second parameter is info, see 3.2 for details. |setTotal()|number|--|Set the maximum value of the progress bar| |getTotal()|--|number|Get the maximum value of the progress bar| |getPercent()|--|number|Get progress bar percentage| |setInfo()|string|--|Set the display information of the progress bar| |isInit()|--|boolean|Get the progress bar initialized| |isPause()|--|boolean|Get the progress bar in pause state| |isCompleted()|--|boolean|Get progress has been completed|

3.2 配置属性列表:

3.2 Configuration attributes list:

中文:

| 属性 | 类型 |缺省值| 描述| | :------: | :------: | :------: | :------: | |title|string|'Progress'|进度条前面的标题| |length|number|50|进度条的长度| |value|number|0|进度条起始值| |total|number|100|进度条总值| |auto|boolean|true|进度条是否自己走动| |time|number|200|进度条自己走动的间隔时间| |ontick|function|null|每次进度条走动的回调函数this:progress参数1:value,参数2:percent| |oncomplete|function|null|进度条完成之后的回调函数this:progress| |add|number|1|进度条每次自己走动的值| |showSpin|boolean|true|是否在进度条前面加上一个旋转的动画和成功或失败的头部字符| |filledChar|string|'∎'|已经完成的进度的字符| |emptyChar|string|'-'|未完成的进度的字符| |completeTitle|string|'Progress Completed'|进度完成的提示文字| |failTitle|string|'Progress Failed'|进度失败的提示文字| |info|string|''|在进度条下一行显示一些信息|

English

| attribute | type |default| description| | :------: | :------: | :------: | :------: | |title|string|'Progress'|Title in front of the progress bar| |length|number|50|The length of the progress bar| |value|number|0|progress bar start value| |total|number|100|progress bar total value| |auto|boolean|true|Whether the progress bar walks by itself| |time|number|200|Interval time of the progress bar itself | |ontick|function|null|Callback function for each progress barthis:progressParameter 1:value, parameter 2:percent| |oncomplete|function|null|callback function after progress bar completionthis:progress| |add|number|1|The value of the progress bar each time you walk around| |showSpin|boolean|true|Is there a rotating animation and a successful or failed header character in front of the progress bar| |filledChar|string|'∎'|Character of completed progress| |emptyChar|string|'-'|Unfinished progress characters| |completeTitle|string|'Progress Completed'|Tips for progress completion| |failTitle|string|'Progress Failed'|Tips for progress failure| |info|string|''|Show some information in the next line of the progress bar|