cli-active-table
v1.1.5
Published
cli tool that helps you render data in command line interface
Downloads
70
Readme
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-tableyarn add cli-active-tablepnpm add cli-active-tableUsage
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);
More examples
Use Сases
Gilhub issues
npm run examples:issuesmultiple table on one screen
npm run examples:multiplecrypto currencies data from api.coingecko.com
npm run examples:cryptobooks list from openlibrary.org
npm run examples:booksspace launches data from api.spacexdata.com
npm run examples:launchesKey bindings
| Component | Key | Description |
| --------------- | ----------- | --------------------- |
| Any | Ctrl+C | Exit application |
| List Section | Tab | Rotate section |
| List Section | Shift+Tab | Back rotate section |
| List Section | Escape | Return selected data |
| List Section | Enter | Open Preview section |
| List Section | Space | Select/Deselect row |
| List Section | Ctrl+a | Select/Deselect all |
| List Section | delete | Delete row |
| List Section | Ctrl+f | Enable search mode |
| Preview Section | Escape | Close Preview section |
| Preview Section | Enter | Close Preview section |
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name - Commit your changes:
git commit -m "Description of changes" - Push to the branch:
git push origin feature-name - Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
