columnify
columnify copied to clipboard
streaming
Should be able to get constant memory usage if columnify processed the data as a stream rather than loading everything and processing it all in one go.
Plan is:
… analysing the first N lines (100?) to gauge appropriate widths then simply use cell wrapping from then on. … for larger datasets all the widths are likely going to hit the maximum anyway so this is actually a non-problem [for column widths]
See https://github.com/npm/npm/issues/6477#issuecomment-71969085