const jq = require('node-jq')
const colors = require('colors')
module.exports = {
  consoleJSON: function(res) {
    try {
      let r = JSON.stringify(res)
      jq.run('.', r, { input: 'string' }).then(res => {
        console.log(colors.green(res))
      })

    } catch (e) {
      console.log(colors.green(res))
    }
  },
  success: function(text) {
    console.log(colors.green(text))

  },
  log: function(text) {
    console.log(text)
  },
  warn: function(text) {
    console.log(colors.yellow(text))
  },
  error: function(text) {
    if (typeof text == 'string') {
      console.log(colors.red(text))
    } else {
      console.log(colors.red(text.toString()))
    }

  }
}
