buntralino-cli
Version:
Buntralino unites Bun and Neutralino.js to make a simpler, lighter alternative to Electron and NW.js. Use Neutralino.js API at client and send harder tasks to Bun while keeping your development process easy.
16 lines (15 loc) • 399 B
text/typescript
import {Spinner} from '@topcli/spinner';
export default async (opts: {
text: string,
finish?: string
}, promise: Promise<unknown>) => {
const spinner = new Spinner().start(opts.text);
try {
const val = await promise;
spinner.succeed(opts.finish ?? opts.text);
return val;
} catch (error) {
spinner.failed(opts.text);
throw error;
}
};