@clack/core
TypeScript icon, indicating that this package has built-in type declarations

0.3.4 • Public • Published

@clack/core

Clack contains low-level primitives for implementing your own command-line applications.

Currently, TextPrompt, SelectPrompt, and ConfirmPrompt are exposed as well as the base Prompt class.

Each Prompt accepts a render function.

import { TextPrompt, isCancel } from '@clack/core';

const p = new TextPrompt({
  render() {
    return `What's your name?\n${this.valueWithCursor}`;
  },
});

const name = await p.prompt();
if (isCancel(name)) {
  process.exit(0);
}

Package Sidebar

Install

npm i @clack/core

Weekly Downloads

267,952

Version

0.3.4

License

MIT

Unpacked Size

308 kB

Total Files

11

Last publish

Collaborators

  • natemoo-re