GT2/Ejectable/node_modules/cli-spinners/index.js

18 lines
448 B
JavaScript
Raw Normal View History

2021-08-16 00:14:59 +00:00
'use strict';
const spinners = Object.assign({}, require('./spinners.json'));
const spinnersList = Object.keys(spinners);
Object.defineProperty(spinners, 'random', {
get() {
const randomIndex = Math.floor(Math.random() * spinnersList.length);
const spinnerName = spinnersList[randomIndex];
return spinners[spinnerName];
}
});
module.exports = spinners;
// TODO: Remove this for the next major release
module.exports.default = spinners;