How to use the easy-table function in easy-table

To help you get started, we’ve selected a few easy-table 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 conundrumer / lr-core / src / test-utils / printSim.js View on Github external
isOnSled = update.isBinded()
          }
        }
        return [i, getUpdateType(type, id), id, isOnSled, ...updates]
      })
  ).reduce((a, b, i) => {
    i += start
    let rider = engine.getRider(i)
    let points = IDs.map((id) =>
      rider.get(id).pos
    ).map(({x, y}) => [x, y])
    .reduce((a, b) => [...a, ...b])
    return [...a, ...b, [i, 'FrameEnd', '', rider.get('RIDER_MOUNTED').isBinded(), ...points]]
  }, [])

  let t = new Table()
  t.separator = '│'

  for (let row of data) {
    row.forEach((cell, i) => {
      let name
      if (i < 4) {
        name = names[i]
      } else {
        i -= 4
        name = IDs[Math.floor(i / 2)].slice(0, 4)
        name += i % 2 === 0 ? 'x' : 'y'
        i += 4
      }
      t.cell(name, cell, i > 3 ? Table.number(2) : null)
    })
    t.newRow()
github alexanderGugel / ied / src / config_cmd.js View on Github external
export default function configCmd () {
	const table = new Table()
	const keys = Object.keys(config)
	for (const key of keys) {
		const value = config[key]
		table.cell('key', key)
		table.cell('value', value)
		table.newRow()
	}

	console.log(table.toString())
}
github alexanderGugel / ied / src / config_cmd.js View on Github external
export default function configCmd () {
	const table = new Table()

  const keys = Object.keys(config)
  for (let key of keys) {
		const value = config[key]
		table.cell('key', key)
		table.cell('value', value)
		table.newRow()
	}

	console.log(table.toString())
}
github browserslist / browserslist-useragent-regexp / src / cli.ts View on Github external
...defaultOptions,
	...regExpOptions
};

end();

if (verbose) {

	const browsersList = getBrowsersList(options);
	const mergedBrowsers = mergeBrowserVersions(browsersList);

	console.log(
		chalk.blue('\n> Browserslist\n')
	);

	const browsersTable = new Table();

	mergedBrowsers.forEach((versions, browser) => {

		browsersTable.cell('Browser', chalk.yellow(browser));

		versions.forEach((version, i) => {

			if (isAllVersion(version)) {
				browsersTable.cell(`Version ${i}`, version[0]);
			} else {
				browsersTable.cell(`Version ${i}`, version.join('.'));
			}
		});

		browsersTable.newRow();
	});
github browserslist / browserslist-useragent-regexp / src / cli.ts View on Github external
optimizedRegExps.forEach(({
		family,
		requestVersionsStrings,
		sourceRegExp,
		resultFixedVersion,
		resultMinVersion,
		resultMaxVersion,
		regExp
	}) => {

		const regExpsTable = new Table();

		regExpsTable.cell('Name', chalk.yellow('Family:'));
		regExpsTable.cell('Value', family);
		regExpsTable.newRow();

		regExpsTable.cell('Name', chalk.yellow('Versions:'));
		regExpsTable.cell('Value', requestVersionsStrings.join(' '));
		regExpsTable.newRow();

		regExpsTable.cell('Name', chalk.yellow('Source RegExp:'));
		regExpsTable.cell('Value', sourceRegExp);
		regExpsTable.newRow();

		regExpsTable.cell('Name', chalk.yellow('Source RegExp fixed version:'));
		regExpsTable.cell('Value', resultFixedVersion ? resultFixedVersion.join('.') : '...');
		regExpsTable.newRow();
github Tencent / feflow / packages / feflow-cli / src / core / index.ts View on Github external
checkUpdate() {
        const { root, rootPkg, config, logger } = this;
        if (!config) {
            return;
        }

        const table = new Table();
        const packageManager = config.packageManager;
        return Promise.all(this.getInstalledPlugins().map(async (name: any) => {
            const pluginPath = path.join(root, 'node_modules', name, 'package.json');
            const content: any = fs.readFileSync(pluginPath);
            const pkg: any = JSON.parse(content);
            const localVersion = pkg.version;
            const registryUrl = await getRegistryUrl(packageManager);
            const latestVersion = await packageJson(name, 'latest', registryUrl).catch((err) => {
                logger.debug('Check plugin update error', err);
            });

            if (latestVersion && latestVersion !== localVersion) {
                table.cell('Name', name);
                table.cell('Version', localVersion === latestVersion ? localVersion : localVersion + ' -> ' + latestVersion);
                table.cell('Tag', 'latest');
                table.cell('Update', localVersion === latestVersion ? 'N' : 'Y');
github browserslist / browserslist-useragent-regexp / src / cli.ts View on Github external
verbose,
	...regExpOptions
}: any = readOptions([
	['help', 'h'],
	['verbose', 'v'],
	'ignorePatch',
	'ignoreMinor',
	'allowHigherVersions',
	'allowZeroVersions'
], []);

if (help) {

	end();

	const optionsTable = new Table();

	optionsTable.cell('Option', 'query');
	optionsTable.cell(
		'Description',
		'Manually provide a browserslist query.'
		+ ' Specifying this overrides the browserslist configuration specified in your project.'
	);
	optionsTable.newRow();

	optionsTable.cell('Option', '--help, -h');
	optionsTable.cell('Description', 'Print this message.');
	optionsTable.newRow();

	optionsTable.cell('Option', '--verbose, -v');
	optionsTable.cell('Description', 'Print additional info about RegExps.');
	optionsTable.newRow();