How to use the cli-spinners.dots10.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 kvz / invig / src / removeVariance.js View on Github external
input = input.replace(/^.*No license field.*\n/gm, '')
  input = input.replace(/^.*Already up-to-date.*\n/gm, '')
  input = input.replace(/^.*Building fresh packages.*\n/gm, '')
  input = input.replace(/^.*Fetching package.*\n/gm, '')
  input = input.replace(/^.*fsevents.*Excluding it from installation.*\n/gm, '')
  input = input.replace(/^.*fsevents.*incompatible with this module.*\n/gm, '')
  input = input.replace(/^.*Linking dependencies.*\n/gm, '')
  input = input.replace(/^.*peer dependency "es6-promise.*\n/gm, '')
  input = input.replace(/^.*Resolving packages.*\n/gm, '')
  input = input.replace(/^.*There appears to be trouble with your network connection.*\n/gm, '')
  input = input.replace(/Done in \d+\.\d+s/g, 'Done in X.Xs')
  input = input.replace(/\d+ms/g, 'XXms')
  input = input.replace(/yarn install v\d+\.\d+\.\d+/g, 'yarn install vX.X.X')

  // @todo: Remove this hack when scrolex no longer adds trailing spinner frames:
  cliSpinner.frames.forEach(frame => {
    while (input.includes(frame)) {
      // console.log({input, frame})
      input = input.replace(frame, '---spinnerframe---')
    }
  })

  return input
}
github kvz / lanyon / src / executive.js View on Github external
_drawAnimation (frame, flush = false) {
    if (!frame) {
      frame = cliSpinner.frames[0]
    }

    let prefix = this._prefix()
    let line   = prefix + frame + ' '

    line += cliTruncate(this._lastLine.trim(), process.stdout.columns - (line.length + (flush ? 2 : 0)))

    if (flush) {
      if (this._status === 0) {
        logUpdate.clear()
        line = prefix + chalk.reset('') + logSymbols.success
      } else {
        line += logSymbols.error
      }
    }
github kvz / lanyon / src / executive.js View on Github external
_startAnimation () {
    let i      = 0
    let frames = cliSpinner.frames
    let that   = this
    this._timer = setInterval(() => {
      let frame = frames[i++ % frames.length]
      this._drawAnimation.bind(that)(frame)
    }, cliSpinner.interval)
  }