How to use the figures.hamburger.repeat function in figures

To help you get started, we’ve selected a few figures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MarcusCemes / responsive-image-builder / src / Controller.ts View on Github external
private render(status?: string, showProgress: boolean = true): void {
    const thisRender = `${status}.${this.completedFiles.length}.${this.failedFiles}.${this.files.length}`;
    if (this.lastRender === thisRender) {
      return;
    }
    this.lastRender = thisRender;

    const complete = this.completedFiles.length + this.failedFiles.length;
    const barWidth = 25;
    const barFilled = Math.min(barWidth, Math.floor((complete / this.files.length) * barWidth));
    const barSpace = barWidth - barFilled;
    const bar = `${chalk.cyan(hamburger.repeat(barFilled))}${chalk.grey(
      hamburger.repeat(barSpace)
    )}`; // █

    status = status ? status : `${chalk.bold.cyan("Get a cup of coffee while I'm working")}`;

    this.terminalLines[1].text = `${DynamicTerminal.SPINNER} ${status}`;
    this.terminalLines[3].text = showProgress ? `${bar}  ${complete}/${this.files.length}` : "";
    if (this.terminal) {
      this.terminal.update(this.terminalLines);
    }
  }
github MarcusCemes / responsive-image-builder / src / Controller.ts View on Github external
private render(status?: string, showProgress: boolean = true): void {
    const thisRender = `${status}.${this.completedFiles.length}.${this.failedFiles}.${this.files.length}`;
    if (this.lastRender === thisRender) {
      return;
    }
    this.lastRender = thisRender;

    const complete = this.completedFiles.length + this.failedFiles.length;
    const barWidth = 25;
    const barFilled = Math.min(barWidth, Math.floor((complete / this.files.length) * barWidth));
    const barSpace = barWidth - barFilled;
    const bar = `${chalk.cyan(hamburger.repeat(barFilled))}${chalk.grey(
      hamburger.repeat(barSpace)
    )}`; // █

    status = status ? status : `${chalk.bold.cyan("Get a cup of coffee while I'm working")}`;

    this.terminalLines[1].text = `${DynamicTerminal.SPINNER} ${status}`;
    this.terminalLines[3].text = showProgress ? `${bar}  ${complete}/${this.files.length}` : "";
    if (this.terminal) {
      this.terminal.update(this.terminalLines);
    }
  }