UNPKG

@sanity/pkg-utils

Version:

Simple utilities for modern npm packages.

17 lines (16 loc) 459 B
import chalk from "chalk"; function createSpinner(msg, quiet = !1) { const startTime = Date.now(); return quiet || console.log(msg), { complete: () => { quiet || console.log(`${chalk.green("[success]")} ${chalk.gray(`${Date.now() - startTime}ms`)}`); }, error: () => { console.log(`${chalk.red("[error]")} ${chalk.gray(`${Date.now() - startTime}ms`)}`); } }; } export { createSpinner }; //# sourceMappingURL=spinner.js.map