The Wayback Machine - https://web.archive.org/web/20200824014609/https://github.com/SheetJS/sheetjs/issues/1922
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stof opened this issue Apr 27, 2020 · 2 comments · May be fixed by #2029
Open

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

stof opened this issue Apr 27, 2020 · 2 comments · May be fixed by #2029
Assignees

Comments

@stof
Copy link

@stof stof commented Apr 27, 2020

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
Copy link
Contributor

@SheetJSDev SheetJSDev commented May 1, 2020

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
Copy link
Author

@stof stof commented May 6, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.