How to use the heroku-cli-util.styledJSON function in heroku-cli-util

To help you get started, we’ve selected a few heroku-cli-util 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 heroku / cli / packages / apps-v5 / src / commands / labs / info.js View on Github external
function * run (context, heroku) {
  let feature
  try {
    feature = yield heroku.get(`/account/features/${context.args.feature}`)
  } catch (err) {
    if (err.statusCode !== 404) throw err
    // might be an app feature
    if (!context.app) throw err
    feature = yield heroku.get(`/apps/${context.app}/features/${context.args.feature}`)
  }
  if (context.flags.json) {
    cli.styledJSON(feature)
  } else {
    print(feature)
  }
}

heroku-cli-util

Set of helpful CLI utilities

ISC
Latest version published 5 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages