How to use the cli-spinners.point 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 enquirer / enquirer / recipes / spinner-separator.js View on Github external
const colors = require('ansi-colors');
const spinners = require('cli-spinners');
const Prompt = require('../lib/prompts/multiselect');
const animate = require('./animate');

const prompt = new Prompt({
  name: 'example-groups',
  message: 'What are your favorite colors?',
  hint: 'Thinking...',
  choices: ['Blue', 'Red', 'Green', 'Orange', 'Yellow']
});

const spinner = animate(prompt, 'separator', spinners.point);

prompt.once('run', () => spinner.start());
prompt.once('close', () => spinner.stop());
setTimeout(() => {
  spinner.stop();
  prompt.enable('Blue');
  prompt.enable('Orange');
  prompt.enable('Green');
  prompt.submit();
}, 3000);

prompt.run()
  .then(answer => console.log('Answer:', answer))
  .catch(console.error);
github enquirer / enquirer / recipes / spinner-choices.js View on Github external
prompt.state.interval = setInterval(() => {
    let completing = prompt.choices.filter(ch => ch.completing);
    if (completing.length) {
      let symb = colors.cyan(frame(spinners.point.frames, ++i));
      prompt.symbols.prefix.pending = symb;
    } else {
      prompt.symbols.prefix = '';
    }
    prompt.render();
  }, 120);
github enquirer / enquirer / recipes / spinners.js View on Github external
prompt.state.interval2 = setInterval(() => {
    sep.update(colors.green(frame(spinners.point.frames, ++j)));
    prompt.render();
  }, 120);
});