netease-music-downloader
Version:
Download music from NetEase Cloud Music
30 lines (29 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMultiBar = createMultiBar;
exports.createSingleBar = createSingleBar;
const cli_progress_1 = require("cli-progress");
function createMultiBar() {
return new cli_progress_1.MultiBar({
clearOnComplete: false,
hideCursor: true,
format: ' [{bar}] {percentage}% || {value}/{total} KB - {name}',
barCompleteChar: '█',
barIncompleteChar: '░',
stopOnComplete: false,
barsize: 30,
noTTYOutput: true,
notTTYSchedule: 1000 // Update every second in non-TTY environments
}, cli_progress_1.Presets.shades_classic);
}
function createSingleBar(options) {
return new cli_progress_1.SingleBar({
format: '下载进度 |{bar}| {percentage}% || {value}/{total} KB',
barCompleteChar: '█',
barIncompleteChar: '░',
hideCursor: true,
noTTYOutput: true,
notTTYSchedule: 1000, // Update every second in non-TTY environments
...options
});
}