How to use the figures.info 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 beakerbrowser / hashbase / lib / archiver.js View on Github external
archive.replicationStreams.forEach(stream => stream.destroy()) // stop all active replications
      archive.replicationStreams.length = 0
      archive.isSwarming = false
      this.swarm.leave(archive.discoveryKey)
    }

    // done?
    if (opts.download === false && opts.upload === false) {
      if (wasSwarming) {
        console.log(figures.info, 'Unswarming archive', datEncoding.toStr(archive.key))
      }
      return
    }

    // join the swarm
    debounceConsole.log(`${figures.info} Swarming archive`, {timeout: 250, max: 1e3}, datEncoding.toStr(archive.key))
    archive.isSwarming = true
    archive.swarmOpts = opts
    this.swarm.listen(archive.discoveryKey, 0, () => {})
  }
github thiagodp / concordialang / dist / plugins / codeceptjs / TestScriptExecutor.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            const iconInfo = chalk_1.default.blueBright(figures_1.info);
            const iconArrow = chalk_1.default.yellow(figures_1.arrowRight);
            const iconError = chalk_1.default.redBright(figures_1.cross);
            const iconWarning = chalk_1.default.yellow(figures_1.warning);
            const textColor = chalk_1.default.cyanBright;
            const textCommand = chalk_1.default.cyan;
            const highlight = chalk_1.default.yellowBright;
            if (!!options.sourceCodeDir) {
                fse.mkdirs(options.sourceCodeDir);
            }
            if (!!options.executionResultDir) {
                fse.mkdirs(options.executionResultDir);
            }
            const executionPath = process.cwd();
            const cfgMaker = new ConfigMaker_1.ConfigMaker();
            const writeF = util_1.promisify(fs_1.writeFile);
            // About codeceptj.json ------------------------------------------------
github x-orpheus / elint / test / unit / utils / log.spec.js View on Github external
it('多类型测试', function () {
      const message = ['hello', 'world!']

      const errorExcept = chalk.red(`\n  ${figures.cross} ${message[0]}\n    ${message[1]}\n`)
      const successExcept = chalk.green(`\n  ${figures.tick} ${message[0]}\n    ${message[1]}\n`)
      const infoExcept = chalk.blue(`\n  ${figures.info} ${message[0]}\n    ${message[1]}\n`)
      const warnExcept = chalk.yellow(`\n  ${figures.warning} ${message[0]}\n    ${message[1]}\n`)

      error(...message)
      success(...message)
      info(...message)
      warn(...message)

      console.log.getCall(0).args[0].should.be.equal(errorExcept)
      console.log.getCall(1).args[0].should.be.equal(successExcept)
      console.log.getCall(2).args[0].should.be.equal(infoExcept)
      console.log.getCall(3).args[0].should.be.equal(warnExcept)
      console.log.callCount.should.be.equal(4)
    })
  })
github beakerbrowser / hashbase / lib / dbs / legacy-leveldb / index.js View on Github external
exports.migrateAsNeeded = async function (cloud, dataPath) {
  var dbPath = path.join(dataPath, 'db')
  if (fs.existsSync(dbPath)) {
    console.log('')
    console.log(figures.star, 'A database migration is required!')
    console.log(figures.heart, 'Don\'t worry, this will be easy.')
    var sqlFilePath = path.join(dataPath, 'legacy-leveldb-to-sqlite-dump.sql')
    var archivedDbPath = path.join(dataPath, 'legacy-leveldb')
    var newDbPath = path.join(dataPath, 'main.db')
    await generateMigrationDump(dbPath, sqlFilePath)
    await generateSqliteDb(cloud)
    console.log(figures.info, 'SQL File:', sqlFilePath)
    console.log(figures.info, 'The old database will be archived at', archivedDbPath)
    console.log(figures.info, 'The new database is at', newDbPath)
    if (!(await ask(figures.play + ' Are you ready to run the migration? (Y/n)', 'y'))) {
      console.log('Okay.')
      console.log('We need to run this migration to start, so Hashbase is now going to close.')
      console.log(figures.pointerSmall, 'Shutting down.')
      process.exit(0)
    }
    archiveOldDb(dbPath, archivedDbPath)
    console.log(figures.star, 'A database migration complete!')
    console.log('')
  }
}
github aragon / aragon-cli / packages / aragon-cli / src / reporters / ConsoleReporter.js View on Github external
message(category = 'info', message) {
    if (this.silent) return

    const color = {
      debug: 'magenta',
      info: 'blue',
      warning: 'yellow',
      error: 'red',
      success: 'green',
    }[category]
    const symbol = {
      debug: figures.pointer,
      info: figures.info,
      warning: figures.warning,
      error: figures.cross,
      success: figures.tick,
    }[category]
    const icon = chalk[color](symbol)
    console.log(` ${icon} ${message}`)
  }
github beakerbrowser / hashbase / lib / apis / archives.js View on Github external
    setInterval(() => console.log(figures.info, this.activeProgressStreams, 'active progress streams'), 60e3)
github klaussinani / signale / src / types.js View on Github external
logLevel: 'error'
  },
  fatal: {
    badge: figures.cross,
    color: 'red',
    label: 'fatal',
    logLevel: 'error'
  },
  fav: {
    badge: figures('❤'),
    color: 'magenta',
    label: 'favorite',
    logLevel: 'info'
  },
  info: {
    badge: figures.info,
    color: 'blue',
    label: 'info',
    logLevel: 'info'
  },
  star: {
    badge: figures.star,
    color: 'yellow',
    label: 'star',
    logLevel: 'info'
  },
  success: {
    badge: figures.tick,
    color: 'green',
    label: 'success',
    logLevel: 'info'
  },
github aragon / aragon-cli / packages / cli / src / reporters / ReporterIcons.js View on Github external
import chalk from 'chalk'
import figures from 'figures'

export const DEBUG_ICON = chalk.magenta(figures.pointer)
export const INFO_ICON = chalk.blue(figures.info)
export const WARNING_ICON = chalk.yellow(figures.warning)
export const ERROR_ICON = chalk.red(figures.cross)
export const SUCCESS_ICON = chalk.green(figures.tick)
github zaaack / foy / src / cli-loading.ts View on Github external
renderDepsTree(depsTree: DepsTree, output: string[] = []) {
    let indent = Array(depsTree.depth * this.props.indent)
      .fill(' ')
      .join('')
    let frames = Spinners.dots.frames as string[]
    let symbol = {
      [TaskState.waiting]: chalk.gray(logFigures.ellipsis),
      [TaskState.pending]: chalk.blueBright(logFigures.arrowRight),
      [TaskState.loading]: chalk.cyan(frames[this.count(depsTree.uid) % frames.length]),
      [TaskState.succeeded]: chalk.green(logFigures.tick),
      [TaskState.failed]: chalk.red(logFigures.cross),
      [TaskState.skipped]: chalk.yellow(logFigures.info),
      ...this.props.symbolMap,
    }[depsTree.state]
    let color =
      (this.props.grayState || [TaskState.waiting]).indexOf(depsTree.state) >= 0
        ? f => chalk.gray(f)
        : f => f
    let skipped = depsTree.state === TaskState.skipped
    output.push(
      `${indent}${symbol} ${color(depsTree.task.name)}${skipped ? chalk.gray(` [skipped]`) : ''}${depsTree.priority ? chalk.gray(` [priority: ${depsTree.priority}]`) : ''}`,
    )
    let childDeps = ([] as DepsTree[])
      .concat(...depsTree.asyncDeps)
      .concat(depsTree.syncDeps)
    for (const child of childDeps) {
      this.renderDepsTree(child, output)
    }