Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

oclif table

// yarn add cli-ux
...
import {Command} from '@oclif/command'
import {cli} from 'cli-ux'

export default class Users extends Command {
  static flags = {
    ...cli.table.flags()
  }

  async run() {
    const {flags} = this.parse(Users)
    /* ... */

    cli.table(users, {
      name: {
        minWidth: 7,
      },
      company: {
        get: row => row.company && row.company.name
      }
    }, {
      printLine: this.log,
      ...flags, // parsed flags
    })
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #oclif #table
ADD COMMENT
Topic
Name
4+6 =