@acegoal07/timestamp-progress 中文文档教程

发布于 3年前 浏览 19 项目主页 更新于 3年前

timestamp-progress

Repository size npm NPM Libraries.io dependency status for latest release GitHub contributors Monthly Downloads


关于   |   用法   |   设置   |   作者


About

将 timeStamps 转换为 progressBar 的简单依赖

安装使用:

npm i @acegoal07/timestamp-progress

Usage

const progress = require('@acegoal07/timestamp-progress');

// Supported timestamp layouts 00:SS, MM:SS or HH:MM:SS
// Input
const duration = "03:20"; // 09:00:28
const position = "01:20"; // 07:00:28

// Creation
const progressBar = progress(position, duration); // Reference progressBar to display

Settings

size - The size of the progress bar ( default: 40 )
timestamp - Weather or not to display timestamp in output ( default: true )
percentage - Whether or not to disable percentage completed instead of ( default: false )
line - The character used to display remaining length ( default: □ ) 
slider - The character used to display the progress ( default: ■ )

如何使用设置: ``` js // 方式一 设置 = { 尺寸:20, 时间戳:假, 百分比:真实, 线: ”-”, 滑块:“#” } const progressBar1 = 进度(位置、持续时间、设置); 控制台日志(progressBar1);

//方式2 const progressBar = progress(position, duration, {size = 20, timestamp = false, percentage = true, line = "-", slider = "#"}); 控制台日志(progressBar2);

timestamp-progress

Repository size npm NPM Libraries.io dependency status for latest release GitHub contributors Monthly Downloads


About   |   Usage   |   Settings   |   Author


About

A simple dependence that converts timeStamps into a progressBar

To install use:

npm i @acegoal07/timestamp-progress

Usage

const progress = require('@acegoal07/timestamp-progress');

// Supported timestamp layouts 00:SS, MM:SS or HH:MM:SS
// Input
const duration = "03:20"; // 09:00:28
const position = "01:20"; // 07:00:28

// Creation
const progressBar = progress(position, duration); // Reference progressBar to display

Settings

size - The size of the progress bar ( default: 40 )
timestamp - Weather or not to display timestamp in output ( default: true )
percentage - Whether or not to disable percentage completed instead of ( default: false )
line - The character used to display remaining length ( default: □ ) 
slider - The character used to display the progress ( default: ■ )

How to use settings: ``` js // Way 1 settings = { size: 20, timestamp: false, percentage: true, line: "-", slider: "#" } const progressBar1 = progress(position, duration, settings); console.log(progressBar1);

// Way 2 const progressBar = progress(position, duration, {size = 20, timestamp = false, percentage = true, line = "-", slider = "#"}); console.log(progressBar2);

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文