@cle-does-things/csv-cli
v0.1.0
Published
Fast CLI to display CSV data as ASCII tables
Maintainers
Readme
csv-cli
A simple and straightforward CLI app to display CSV files as ASCII tables, written in TypeScript.
Built on top of sunbears, a fast CSV data loader inspired by Polars and Pandas, written in Rust.
$~ csv-cli sample.csv
+------------------------------------------------------------+
| sample.csv |
+----+-----+---------------+-------------------+-------------+
| id | age | name | email | city |
+----+-----+---------------+-------------------+-------------+
| 1 | 28 | Alice Johnson | [email protected] | New York |
| 2 | 34 | Bob Smith | [email protected] | Los Angeles |
| 3 | 22 | Carol White | [email protected] | Chicago |
| 4 | 45 | David Brown | [email protected] | Houston |
| 5 | 31 | Eva Martinez | [email protected] | Phoenix |
+----+-----+---------------+-------------------+-------------+Installation
Install with:
npm i -g @cle-does-things/csv-cliVerify installation with:
csv-cli --helpInstallation might fail without internet access, as it requires to download binaries from GitHub Releases
Usage
csv-cli simply needs the path to the CSV file as positional arguments, and it will display the data contained in it as an ASCII table:
csv-cli sample.csvOptionally, you can provide a maximum number of rows to display (-l/--limit, default is 100):
csv-cli sample.csv --limit 5You can also specify a set of columns to display, as a comma-separated string (-c/--columns, defaults to show all columns):
csv-cli sample.csv --columns email,ageLastly, you can show the time taken to display the table (-t, --time, defaults to not showing the time):
csv-cli sample.csv --timeDevelopment
Linting
bun run format # prettier
bun run lint # eslint ´Testing
Tests are defined in utils.test.ts:
bun testBuilding
Bundled as a JS file:
bun run build # -> dist/index.jsAs a compiled binary:
bun run build:bin # -> bin/csv-cli-<os>-<arch>License
MIT
