UNPKG

487 BJavaScriptView Raw
1const ora = require('ora')
2const spinners = require('cli-spinners')
3
4/**
5 * 使用 ora 创建读取中转圈动画
6 * @param {Object} options
7 * @returns {Object} ora 对象
8 */
9module.exports = (options = {}) =>
10 ora(
11 Object.assign(
12 {
13 spinner: spinners.dots,
14 color: 'cyan'
15 },
16 typeof options === 'string' ? {
17 text: options
18 } : options
19 )
20 ).start()