0.0.2 • Published 1 year ago

@reuters-graphics/clack v0.0.2

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

@reuters-graphics/clack

Additional prompts and specifically styled ones we use with clack at Reuters Graphics.

Installation

pnpm install @reuters-graphics/clack

Demo

Open in StackBlitz

Prompts

datetime

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';
    }
  },
});

intro

import { intro } from '@reuters-graphics/clack';

intro('My CLI');

note

import { note } from '@reuters-graphics/clack';

note('My message', 'title');

spinner

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');
0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago