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.
16 lines
337 B
16 lines
337 B
8 years ago
|
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)
|
||
|
}
|
||
|
}
|