1.1.5 • Published 5 months ago

cli-active-table v1.1.5

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

npm license downloads

cli-active-table

Is an npm package for Node.js CLI applications that provides interactive tables with keyboard navigation, preview, and support for rendering multiple lists.

Installation

To install the package, use the one of the following commands depending on you package manager:

npm install cli-active-table
yarn add cli-active-table
pnpm add cli-active-table

Usage

Basic usage

const data = [
  { id: 1, name: 'name1', description: 'description1' },
  { id: 2, name: 'name2', description: 'description2' },
  { id: 3, name: 'name3', description: 'description3' },
];
const table = new ActiveTable([{ data }]);
const result = await table.handle();
console.log(result);

Screenshot 1

More examples

Multiple tables

Validation

Sorting

Search

Use Сases

Gilhub issues

npm run examples:issues

multiple table on one screen

npm run examples:multiple

crypto currencies data from api.coingecko.com

npm run examples:crypto

books list from openlibrary.org

npm run examples:books

space launches data from api.spacexdata.com

npm run examples:launches

Key bindings

ComponentKeyDescription
AnyCtrl+CExit application
List SectionTabRotate section
List SectionShift+TabBack rotate section
List SectionEscapeReturn selected data
List SectionEnterOpen Preview section
List SectionSpaceSelect/Deselect row
List SectionCtrl+aSelect/Deselect all
List SectiondeleteDelete row
List SectionCtrl+fEnable search mode
Preview SectionEscapeClose Preview section
Preview SectionEnterClose Preview section

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix: git checkout -b feature-name
  3. Commit your changes: git commit -m "Description of changes"
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

1.1.5

5 months ago

1.1.4

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.0.6

5 months ago

1.0.5

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.0

6 months ago