You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
349 B

const ora = require('ora');
const chalk = require('chalk');
const { eraseLine } = require('ansi-escapes');
// Prints a spinner followed by the given text
module.exports = msg => {
const spinner = ora(chalk.gray(msg));
spinner.color = 'gray';
spinner.start();
return () => {
spinner.stop();
process.stdout.write(eraseLine);
};
};