[RFC] Split out the CLI into a separate package #1922

Closed
opened 2020-04-27 16:20:18 +00:00 by stof · 3 comments
stof commented 2020-04-27 16:20:18 +00:00 (Migrated from github.com)

Currently, some of the dependencies of this package are related to its CLI tool (which is not even mentioned in the readme AFAICT). These dependencies (commander and exit-on-epipe at least) are unnecessary for projects using the library. To reduce the install footprint, what do you think about splitting the CLI into a separate package (that can then be installed only when you actually need it) ?

Note that to actually benefit from the smaller install footprint, this should also be done in other packages you maintain (crc-32, adler-32, cfb and codepage), as they also include their own CLI with these dependencies (btw, currently, this forces the install of 2 different versions of commander due to xlsx using an older version than codepage)

Currently, some of the dependencies of this package are related to its CLI tool (which is not even mentioned in the readme AFAICT). These dependencies (`commander` and `exit-on-epipe` at least) are unnecessary for projects using the library. To reduce the install footprint, what do you think about splitting the CLI into a separate package (that can then be installed only when you actually need it) ? Note that to actually benefit from the smaller install footprint, this should also be done in other packages you maintain (`crc-32`, `adler-32`, `cfb` and `codepage`), as they also include their own CLI with these dependencies (btw, currently, this forces the install of 2 different versions of `commander` due to `xlsx` using an older version than `codepage`)
SheetJSDev commented 2020-05-01 19:36:59 +00:00 (Migrated from github.com)

It's buried in the README: https://github.com/SheetJS/sheetjs#parsing-and-writing-examples

The node version installs a command line tool xlsx which can read spreadsheet files and output the contents in various formats. The source is available at xlsx.njs in the bin directory.

That said, this is a reasonable idea. Should the CLI be split off (a module like xlsx-cli) or should the library move (so the main xlsx module would be a reexport of something like xlsx-lib)

It's buried in the README: https://github.com/SheetJS/sheetjs#parsing-and-writing-examples > The node version installs a command line tool xlsx which can read spreadsheet files and output the contents in various formats. The source is available at xlsx.njs in the bin directory. That said, this is a reasonable idea. Should the CLI be split off (a module like `xlsx-cli`) or should the library move (so the main `xlsx` module would be a reexport of something like `xlsx-lib`)
stof commented 2020-05-06 08:39:14 +00:00 (Migrated from github.com)

Well, I don't have an opinion on the option you select. I'm fine if I have to replace xlsx with xlsx-lib (or whatever the name you choose) in my project to benefit from that.
However, looking at the npm ecosystem, I think it is more common to have a -cli separate package for the CLI, when the CLI is not the main use case of the library.

Well, I don't have an opinion on the option you select. I'm fine if I have to replace `xlsx` with `xlsx-lib` (or whatever the name you choose) in my project to benefit from that. However, looking at the npm ecosystem, I think it is more common to have a `-cli` separate package for the CLI, when the CLI is not the main use case of the library.
reviewher commented 2021-11-07 00:37:01 +00:00 (Migrated from github.com)
c1f5f04
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#1922
No description provided.