Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

Justify columns #30

Open
adam-cyclones opened this issue Jan 3, 2017 · 0 comments
Open

Justify columns #30

adam-cyclones opened this issue Jan 3, 2017 · 0 comments

Comments

@adam-cyclones
Copy link

adam-cyclones commented Jan 3, 2017

For future searches, and this is also a bit of a feature request too.
I think it could be fairly trivial to patch something like this as a boolean, {justify:true}, the harder bit is using the process.stdout.on('resize') event to make this responsive.

Thanks for this amazing tool!

//add this to your constructor settings and your columns will justify base on your headings.
get colWidths(){
    let len = (process.stdout.columns / this.head.length);
    return this.head.map(heading => Math.floor(len))  
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant