File: example.js

package info (click to toggle)
node-cli-spinners 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 644 kB
  • sloc: javascript: 124; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 322 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';
const logUpdate = require('log-update');
const cliSpinners = require('.');

const spinner = cliSpinners[process.argv[2] || 'dots'];
let i = 0;

setInterval(() => {
	const {frames} = spinner;
	logUpdate(frames[i = ++i % frames.length] + ' Unicorns');
}, spinner.interval);

// $ node example.js nameOfSpinner