graphqldoc
Version:
Generate GraphQL docs from schema.
24 lines (23 loc) • 731 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Output {
constructor(out, options) {
this.out = out;
this.options = options;
}
ok(ref, value) {
this.out.log('%c ✓ %s: %c%s', 'color:green', ref, 'color:grey', value);
}
info(ref, value) {
if (this.options.verbose)
this.out.log('%c ❭ %s: %c%s', 'color:yellow', ref, 'color:grey', value);
}
error(err) {
this.out.error('%c ✗ %s', 'color:red', err.message || err);
if (this.options.verbose)
this.out.error('%c%s', 'color:grey', err.stack || ' NO STACK');
this.out.error('');
process.exit(1);
}
}
exports.Output = Output;