Additional prompts and specifically styled ones we use with clack at Reuters Graphics.
pnpm install @reuters-graphics/clack
import { datetime } from '@reuters-graphics/clack';
const date = await datetime({
message: 'Pick a date and time',
initialValue: new Date(),
validate: (value) => {
if (value.getTime() < new Date().getTime()) {
return 'Date must be in the future';
}
},
});
import { intro } from '@reuters-graphics/clack';
intro('My CLI');
import { note } from '@reuters-graphics/clack';
note('My message', 'title');
A spinner that runs for at least a number of milliseconds.
import { spinner } from '@reuters-graphics/clack';
const s = spinner(1000);
s.start('Building');
// ...
await s.end('🏁 Built')
5FFA
;