{"size": 988, "ext": "js", "max_stars_repo_path": "scripts/colors.js", "max_stars_repo_name": "Gozeon/code-collections", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "scripts/colors.js", "max_issues_repo_name": "Gozeon/code-collections", "max_issues_repo_issues_event_min_datetime": "2020-07-17T09:25:42.000Z", "max_issues_repo_issues_event_max_datetime": "2020-07-17T09:25:42.000Z", "max_forks_repo_path": "scripts/colors.js", "max_forks_repo_name": "Gozeon/code-collections", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 28.2285714286, "max_line_length": 56, "alphanum_fraction": 0.6649797571}
const util = require('util')

function colorize(color, text) {
  const codes = util.inspect.colors[color]
  return `\x1b[${codes[0]}m${text}\x1b[${codes[1]}m`
}

function colors() {
  let returnValue = {}
  Object.keys(util.inspect.colors).forEach((color) => {
    returnValue[color] = (text) => colorize(color, text)
  })

  return returnValue
}

module.exports = colors()

// test.js
// const colors = require('./color');

// console.log(colors.bold('i am bold'))
// console.log(colors.italic('i am italic'))
// console.log(colors.underline('i am green'))
// console.log(colors.inverse('i am inverse'))
// console.log(colors.white('i am white'))
// console.log(colors.grey('i am grey'))
// console.log(colors.black('i am black'))
// console.log(colors.blue('i am blue'))
// console.log(colors.cyan('i am cyan'))
// console.log(colors.green('i am green'))
// console.log(colors.magenta('i am magenta'))
// console.log(colors.red('i am red'))
// console.log(colors.yellow('i am yellow'))
