How to use elegant-spinner - 8 common examples

To help you get started, we’ve selected a few elegant-spinner 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 DevExpress / testcafe / src / cli / log.js View on Github external
showSpinner () {
        // NOTE: we can use the spinner only if stdout is a TTY and we are not in CI environment (e.g. TravisCI),
        // otherwise we can't repaint animation frames. Thanks https://github.com/sindresorhus/ora for insight.
        if (this.isAnimated) {
            const spinnerFrame = elegantSpinner();

            this.animation = setInterval(() => {
                const frame = chalk.cyan(spinnerFrame());

                logUpdate(frame);
            }, 50);
        }
    },
github neo-one-suite / neo-one / packages / neo-one-cli / src / interactive / createCRUD.js View on Github external
const getSymbol = (task: TaskStatus, spinners: Spinners) => {
  if (spinners[task.id] == null) {
    // eslint-disable-next-line
    spinners[task.id] = elegantSpinner();
  }

  const hasSubtasks = task.subtasks != null && task.subtasks.length > 0;
  if (task.pending) {
    return hasSubtasks ? pointer : chalk.yellow(spinners[task.id]());
  }

  if (task.complete) {
    return logSymbols.success;
  }

  if (task.error != null) {
    return hasSubtasks ? pointer : logSymbols.error;
  }

  if (task.skipped != null) {
github mr-doc / mr-doc / lib / theme.js View on Github external
'use strict';
import when from 'when';
import Path from 'path';
import _ from 'lodash';
import File from 'fs-extra';
import elegantSpinner from 'elegant-spinner';
import logUpdate from 'log-update';
import Dir from './dir';
import 'source-map-support/register';
let frame = elegantSpinner();
/**  
 * The class that locates themes  
 * @class Theme  
 */
class Theme {
  constructor(options) {
      if (options) {
        // Check if Doc will be installing a theme
        // or will be rendering a template
        let resolved = {
          theme: options.template.path ? undefined : Theme.findTheme(options)
        };
        // Set the options
        this.options = {
          theme: {
            name: resolved.theme ?
github Hashnode / mern-cli / src / commands / main.js View on Github external
import program from 'commander';
import chalk from 'chalk';
import elegantSpinner from 'elegant-spinner';
import logUpdate from 'log-update';
import pjson from '../../package.json';
require('shelljs/global');

const frame = elegantSpinner();

program
    .version(pjson.version)
    .description('Create a MERN app in current directory!')
    .option('-v, --version', 'check version')
    .parse(process.argv);


if (!which('git')) {
    console.log(chalk.red('Sorry, this script requires git'));
    exit(1);
}

if (program.args.length > 1) {
    console.log(chalk.red('Please give only one argument as a directory name!!!'));
    exit(1);
github Hashnode / mern-cli / src / commands / main-init.js View on Github external
import program from 'commander';
import chalk from 'chalk';
import elegantSpinner from 'elegant-spinner';
import logUpdate from 'log-update';
import variants from '../../variants.json';
require('shelljs/global');

const frame = elegantSpinner();

program
    .description('Create a MERN app in current directory!')
    .option('-t, --target [name]', 'Initialize the project with a variant [mern-starter]', 'mern-starter')
    .parse(process.argv);

if (!which('git')) {
    console.log(chalk.red('Sorry, this script requires git'));
    exit(1);
}

if (program.args.length > 1) {
    console.log(chalk.red('Please give only one argument as a directory name!!!'));
    exit(1);
}
github milesj / boost / src / TaskResult.js View on Github external
spinner(): string {
    if (!this.spinnerFrames) {
      this.spinnerFrames = spinner();
    }

    return this.spinnerFrames();
  }
}
github SpencerCDixon / redux-cli / src / models / ui.js View on Github external
import { EOL } from 'os';
import chalk from 'chalk';
import elegantSpinner from 'elegant-spinner';
import logUpdate from 'log-update';

const frame = elegantSpinner();
const DEFAULT_WRITE_LEVEL = 'INFO';
const WRITE_LEVELS = {
  DEBUG: 1,
  INFO: 2,
  WARNING: 3,
  ERROR: 4
};

class UI {
  constructor(options = {}) {
    this.inputStream = options.inputStream || process.stdin;
    this.outputStream = options.outputStream || process.stdout;
    this.errorStream = options.errorStream || process.stderr;

    this.writeLevel = options.writeLevel || DEFAULT_WRITE_LEVEL;
    this.streaming = false;
github keindev / tasktree / src / theme.ts View on Github external
import chalk from 'chalk';
import convert from 'color-convert';
import elegantSpinner from 'elegant-spinner';
import { Wrapper } from 'stdout-update/lib/wrapper';
import { Terminal } from 'stdout-update/lib/terminal';
import * as Figures from 'figures';
import { Task, TaskStatus } from './task';
import { ProgressBar } from './progress-bar';

const frame = elegantSpinner();

export enum IndicationType {
    Default = 'default',
    Active = 'active',
    Success = 'success',
    Skip = 'skip',
    Error = 'error',
    Message = 'message',
    Info = 'info',
    Warning = 'warning',
    Subtask = 'subtask',
    List = 'list',
    Dim = 'dim',
}

export enum IndicationColor {

elegant-spinner

Elegant spinner for interactive CLI apps

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis

Popular elegant-spinner functions