How to use columnify - 7 common examples

To help you get started, we’ve selected a few columnify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vivaxy / granturismo / src / commands / config.js View on Github external
const list = () => {
    const userConfig = configManager.read().scaffold;
    const scaffoldList = configManager.readScaffoldListByStatOrder();
    const data = scaffoldList.map((scaffold) => {
        return { stat: userConfig[scaffold].stat, name: scaffold, repo: userConfig[scaffold].repo };
    });
    console.log(columnify(data)); // eslint-disable-line no-console
};
github SomeoneWeird / cirrus / src / utils.js View on Github external
id: event.LogicalResourceId,
        status: `- ${event.ResourceStatus}`
      }

      if (event.ResourceStatusReason) {
        out.reason = ` (${event.ResourceStatusReason})`
      }

      return out
    })

    if (argv.limit) {
      events = events.slice(events.length - argv.limit, events.length)
    }

    console.log(columnify(events, {
      showHeaders: false
    }))
  }
github twilio-labs / twilio-run / src / printers / list.ts View on Github external
function prettyPrintVariables(variables: VariablesContent) {
  const { entries } = variables;

  const updatedRows = entries.map((entry: VariableResource) => {
    return {
      ...entry,
      key: chalk`{dim │} {cyan ${entry.key}}:`,
    };
  });

  const renderedValues = columnify(updatedRows, {
    columns: ['key', 'value'],
    showHeaders: false,
  });

  return renderedValues;
}
github twilio-labs / twilio-run / src / printers / utils.ts View on Github external
export function printObjectWithoutHeaders(obj: {}): string {
  return columnify(obj, { showHeaders: false });
}
github twilio-labs / twilio-run / src / printers / deploy.ts View on Github external
function plainPrintDeployedResources(
  config: DeployLocalProjectConfig,
  result: DeployResult
) {
  const functionsOutput: string = columnify(
    result.functionResources.sort(sortByAccess).map(fn => ({
      ...fn,
      url: `https://${result.domain}${fn.path}`,
    })),
    {
      columns: ['access', 'path', 'url'],
      showHeaders: false,
    }
  );

  const assetsOutput: string = columnify(
    result.assetResources.sort(sortByAccess).map(asset => ({
      ...asset,
      url: `https://${result.domain}${asset.path}`,
    })),
    {
github twilio-labs / twilio-run / src / printers / list.ts View on Github external
function printRows(rows: any[], keys: string[]) {
  return columnify(rows, { columns: keys, headingTransform });
}
github hashicorp / vault / ui / app / components / console / log-object.js View on Github external
columns: computed('content', function() {
    let data = this.content;
    stringifyObjectValues(data);

    return columnify(data, {
      preserveNewLines: true,
      headingTransform: function(heading) {
        return capitalize(heading);
      },
    });
  }),
});

columnify

Render data in text columns. Supports in-column text-wrap.

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis

Popular columnify functions