@nestbox-ai/cli
Version:
The cli tools that helps developers to build agents
39 lines • 1.49 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.displayImagesTable = displayImagesTable;
const cli_table3_1 = __importDefault(require("cli-table3"));
const chalk_1 = __importDefault(require("chalk"));
// Helper function to display images in a table
function displayImagesTable(images) {
const table = new cli_table3_1.default({
head: [
chalk_1.default.white.bold('Name'),
chalk_1.default.white.bold('Type'),
chalk_1.default.white.bold('License'),
chalk_1.default.white.bold('Category'),
chalk_1.default.white.bold('Pricing'),
chalk_1.default.white.bold('Source')
],
style: {
head: [],
border: []
}
});
// Add rows to the table
images.forEach((image) => {
var _a, _b, _c;
table.push([
image.name || 'N/A',
image.type || 'N/A',
((_a = image.metadata) === null || _a === void 0 ? void 0 : _a.License) || 'N/A',
((_b = image.metadata) === null || _b === void 0 ? void 0 : _b.Type) || 'N/A',
((_c = image.metadata) === null || _c === void 0 ? void 0 : _c.Pricing) || 'N/A',
image.source || 'N/A'
]);
});
console.log(table.toString());
}
//# sourceMappingURL=display.js.map