draig-car
Version:
Database REST API interactive generator CLI and REPL OpenAPI3 based JS generator with interactive ORM/ODM REPL
15 lines (12 loc) • 399 B
JavaScript
const yaml = require('js-yaml')
const chalk = require('chalk')
const u = require('../util')
const c = require('./common')
module.exports.printAction = function(args) {
let ctx = this.context
let [value] = c.apiValue(ctx, args)
if (typeof value === 'undefined')
console.log(chalk`Sorry, element at {yellow ${args}} not found`)
else u.printYaml(yaml.safeDump(value))
u.exitOrContinue(this)
}