table-printer.js 634 B

123456789101112131415161718192021222324252627
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * The MIT License (MIT)
  5. * Copyright (c) 2015-present Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
  6. */
  7. var Table = require('cli-table3');
  8. /**
  9. * Wrapper class over `cli-table3` with default options preset.
  10. */
  11. var TablePrinter = function TablePrinter(options) {
  12. _classCallCheck(this, TablePrinter);
  13. return new Table(Object.assign({}, options, {
  14. style: {
  15. head: ['blue'],
  16. border: ['gray']
  17. }
  18. }));
  19. };
  20. module.exports = TablePrinter;