How to use the cli-spinners.dots.frames function in cli-spinners

To help you get started, we’ve selected a few cli-spinners 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 moneyhub / navy / packages / navy / src / cli / updates.js View on Github external
/* @flow */

import chalk from 'chalk'
import readline from 'readline'
import {dots} from 'cli-spinners'
import {getNavy} from '../'
import table from '../util/table'
import hasUpdate from '../util/has-update'

const debug = require('debug')('navy:updates')

let spinnerIndex = 0
let spinnerFrame = dots.frames[0]

function renderStatus(status) {
  if (status == null) {
    return chalk.yellow(spinnerFrame) + ' ' + chalk.dim('Checking...')
  } else if (status === true) {
    return chalk.yellow('• Update available')
  } else if (status === 'UNKNOWN_REMOTE') {
    return chalk.red('• Not found')
  } else if (status === 'UNKNOWN_ERROR') {
    return chalk.red('• Internal error')
  } else if (status === 'NO_IMAGE') {
    return chalk.red('• No image for service')
  } else {
    return chalk.green('✔ Up to date')
  }
}
github musically-ut / appreciate / cli.js View on Github external
return api.getName(x);
            });

            spinnerNames.sort();

            const maxPadding = Math.max.apply(
                null,
                spinnerNames.map(x => {
                    return x.length;
                })
            );

            const multiSpinners = new Multispinner(spinnerNames, {
                clear: false,
                autoStart: true,
                frames: dotsSpinner.frames,
                interval: dotsSpinner.interval
            });

            let allModuleInfos = uniqueModuleInfos.map(x => {
                return makeTask(token, x, multiSpinners, maxPadding);
            });

            // Place checking for musically-ut/appreciate at the top of the
            // list for recovery afterwards.
            allModuleInfos.unshift(checkIsAppreciateAppreciated(token, multiSpinners));

            return Promise.all(allModuleInfos);
        })
        .then(allModuleInfosResolved => {
github moneyhub / navy / packages / navy / src / driver-logging.js View on Github external
function _redraw(opts = {}) {
  let symbol = chalk.cyan(dots.frames[_spinnerIndex])

  if (opts.success === true) {
    symbol = chalk.green('✔')
  } else if (opts.success === false) {
    symbol = chalk.red('•')
  }

  if (!process.stdout.isTTY) {
    if (opts.success) {
      console.log()
      console.log(symbol, 'SUCCESS')
    } else if (opts.success === false) {
      console.log()
      console.log(symbol, 'FAILURE')
    }
    return
github bs-community / blessing-skin-server / resources / assets / src / scripts / cli / Spinner.ts View on Github external
this.timerId = window.setInterval(() => {
      this.index += 1
      this.index %= dots.frames.length

      this.stdio.reset()
      this.stdio.print(`${dots.frames[this.index]} ${message}`)
    }, dots.interval)
  }
github SBoudrias / Inquirer.js / packages / core / index.js View on Github external
getPrefix() {
    const { status, loadingIncrement } = this.getState();
    let prefix = chalk.green('?');
    if (status === 'loading') {
      const frame = loadingIncrement % spinner.frames.length;
      prefix = chalk.yellow(spinner.frames[frame]);
    }

    return prefix;
  }
github moneyhub / navy / packages / navy / src / driver-logging.js View on Github external
_spinnerInterval = setInterval(() => {
    _spinnerIndex++

    if (_spinnerIndex >= dots.frames.length) {
      _spinnerIndex = 0
    }

    _redraw()
  }, dots.interval)
}
github bs-community / blessing-skin-server / resources / assets / src / scripts / cli / Spinner.ts View on Github external
this.timerId = window.setInterval(() => {
      this.index += 1
      this.index %= dots.frames.length

      this.stdio.reset()
      this.stdio.print(`${dots.frames[this.index]} ${message}`)
    }, dots.interval)
  }
github SBoudrias / Inquirer.js / packages / core / index.js View on Github external
getPrefix() {
    const { status, loadingIncrement } = this.getState();
    let prefix = chalk.green('?');
    if (status === 'loading') {
      const frame = loadingIncrement % spinner.frames.length;
      prefix = chalk.yellow(spinner.frames[frame]);
    }

    return prefix;
  }
github moneyhub / navy / packages / navy / src / cli / updates.js View on Github external
const spinner = setInterval(() => {
    spinnerIndex++

    if (spinnerIndex >= dots.frames.length) {
      spinnerIndex = 0
    }

    spinnerFrame = dots.frames[spinnerIndex]

    redraw()
  }, dots.interval)