SILENT KILLERPanel

Current Path: > > lib > node_modules > npm > node_modules > gauge


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //lib/node_modules/npm/node_modules/gauge

NameTypeSizeLast ModifiedActions
node_modules Directory - -
CHANGELOG.md File 6376 bytes March 10 2021 14:36:39.
LICENSE File 751 bytes March 10 2021 14:36:39.
README.md File 15073 bytes March 10 2021 14:36:39.
base-theme.js File 395 bytes March 10 2021 14:36:39.
error.js File 616 bytes March 10 2021 14:36:39.
has-color.js File 292 bytes March 10 2021 14:36:39.
index.js File 6999 bytes March 10 2021 14:36:39.
package.json File 2181 bytes March 10 2021 14:36:39.
plumbing.js File 1269 bytes March 10 2021 14:36:39.
process.js File 89 bytes March 10 2021 14:36:39.
progress-bar.js File 998 bytes March 10 2021 14:36:39.
render-template.js File 5739 bytes March 10 2021 14:36:39.
set-immediate.js File 139 bytes March 10 2021 14:36:39.
set-interval.js File 93 bytes March 10 2021 14:36:39.
spin.js File 105 bytes March 10 2021 14:36:39.
template-item.js File 1904 bytes March 10 2021 14:36:39.
theme-set.js File 3693 bytes March 10 2021 14:36:39.
themes.js File 1543 bytes March 10 2021 14:36:39.
wide-truncate.js File 828 bytes March 10 2021 14:36:39.

Reading File: //lib/node_modules/npm/node_modules/gauge/progress-bar.js

'use strict'
var validate = require('aproba')
var renderTemplate = require('./render-template.js')
var wideTruncate = require('./wide-truncate')
var stringWidth = require('string-width')

module.exports = function (theme, width, completed) {
  validate('ONN', [theme, width, completed])
  if (completed < 0) completed = 0
  if (completed > 1) completed = 1
  if (width <= 0) return ''
  var sofar = Math.round(width * completed)
  var rest = width - sofar
  var template = [
    {type: 'complete', value: repeat(theme.complete, sofar), length: sofar},
    {type: 'remaining', value: repeat(theme.remaining, rest), length: rest}
  ]
  return renderTemplate(width, template, theme)
}

// lodash's way of repeating
function repeat (string, width) {
  var result = ''
  var n = width
  do {
    if (n % 2) {
      result += string
    }
    n = Math.floor(n / 2)
    /*eslint no-self-assign: 0*/
    string += string
  } while (n && stringWidth(result) < width)

  return wideTruncate(result, width)
}

SILENT KILLER Tool