2.1.0 • Published 11 months ago

ez-cli-tools v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

EZ CLI Tools

A Typescript first CLI tools for Node.js with zero dependencies. Easy to use to get command line input from questions and generating lists of options that the user can select from.

npm npm GitHub

Installation

NPM

npm install ez-cli-tools

Yarn

yarn add ez-cli-tools

PNPM

pnpm add ez-cli-tools

Usage

Brief Example

import { writeLine, ask, select, printSpinner, endIntervalAndClearStatus } from 'ez-cli-tools';
import { setTimeout } from 'timers/promises';

(async () => {
  const name = await ask('What is your name?');
  writeLine(`Hello ${name}`);
  const game = await select('Shall we play a game?', ['Checkers', 'Chess', 'Tic-Tac-Toe', 'Global Thermonuclear War']);
  writeLine(`Great! Let's play ${game}`);
  const intervalId = printSpinner();
  await setTimeout(10000); // Normally you would be doing a long running operation here, which is why you would show a spinner
  endIntervalAndClearStatus(intervalId);
  writeLine('An interesting game. The only winning move is not to play.');
})();
2.0.2

11 months ago

2.1.0

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

2.0.0

11 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago