#! /usr/bin/env node

import { bold, green, red } from 'chalk';
import console from 'console';

import gitAuthorStats from './git-author-stats';

gitAuthorStats().forEach((gitAuthorStat) => {
  const {
    author,
    commits,
    added,
    removed,
  } = gitAuthorStat;

  const gitAuthorText = [
    `${commits} commits`,
    green(`${added} ++`),
    red(`${removed} --`),
  ].join(' / ');

  console.log(`${bold(author)}: ${gitAuthorText}`);
});

#! /usr/bin/env node

import chalk from 'chalk';
import console from 'console';

import gitAuthorStats from './git-author-stats';

gitAuthorStats().forEach((gitAuthorStat) => {
  const author = chalk.bold(gitAuthorStat.author);
  const commits = `${gitAuthorStat.commits} commits`;
  const added = chalk.green(`${gitAuthorStat.added} ++`);
  const removed = chalk.red(`${gitAuthorStat.removed} --`);

  const authorStats = [commits, added, removed].join(' / ');

  console.log(`${author}: ${authorStats}`);
});

--- 
+++ 
@@ -1,23 +1,17 @@
 #! /usr/bin/env node
 
-import { bold, green, red } from 'chalk';
+import chalk from 'chalk';
 import console from 'console';
 
 import gitAuthorStats from './git-author-stats';
 
 gitAuthorStats().forEach((gitAuthorStat) => {
-  const {
-    author,
-    commits,
-    added,
-    removed,
-  } = gitAuthorStat;
+  const author = chalk.bold(gitAuthorStat.author);
+  const commits = `${gitAuthorStat.commits} commits`;
+  const added = chalk.green(`${gitAuthorStat.added} ++`);
+  const removed = chalk.red(`${gitAuthorStat.removed} --`);
 
-  const gitAuthorText = [
-    `${commits} commits`,
-    green(`${added} ++`),
-    red(`${removed} --`),
-  ].join(' / ');
+  const authorStats = [commits, added, removed].join(' / ');
 
-  console.log(`${bold(author)}: ${gitAuthorText}`);
+  console.log(`${author}: ${authorStats}`);
 });
Refactor Git author text writing
