constatic
Version:
Constatic is a CLI for creating and managing modern TypeScript projects, providing an organized structure and features that streamline development.
28 lines (27 loc) • 759 B
JavaScript
// src/menus/main/presets/tokens/menu-list.ts
import { cliTableChars, divider, sleep, uiMessage } from "#helpers";
import { menus } from "#menus";
import ck from "chalk";
import Table from "cli-table3";
async function presetsTokensListMenu(cli, tokens) {
const cc = {
name: uiMessage({ "en-US": "Name", "pt-BR": "Nome" }, ck.white),
id: uiMessage({ "en-US": "ID", "pt-BR": "ID" }, ck.white)
};
const table = new Table({
head: [cc.name, cc.id],
style: { compact: true },
chars: cliTableChars
});
tokens.forEach((token) => table.push([
ck.yellow(token.name),
ck.green(token.id)
]));
console.log(table.toString());
divider();
await sleep(500);
menus.presets.tokens.main(cli);
}
export {
presetsTokensListMenu
};