如何在nodejs中显示ASCII ART(终端中)旁边的文本?
我想以这种格式显示一些ASCII艺术:
_,-, Name: Powerful Axe
T_ | Rarity: Yellow Rarity (77.5)
||`-' Attack: 100
|| Defense: 100
|| Speed: 100
~~ Gold Value: 10
an axe that is really rare
我希望它在列布局中,就像Neofetch一样,但在Nodejs中。 我从JSON文件中获取所有这些数据,并且我正在使用以下函数将关键对类型值格式化和上色:
const chalk = require('chalk')
function keyValue(key, value) {
return chalk.green(key) + ": " + chalk.yellow(value)
}
所有这些都需要在终端中,最好不使用节点curses或有福。
I would like to display some ascii art in this format:
_,-, Name: Powerful Axe
T_ | Rarity: Yellow Rarity (77.5)
||`-' Attack: 100
|| Defense: 100
|| Speed: 100
~~ Gold Value: 10
an axe that is really rare
I want it in a column layout, kind of like neofetch does, but in NodeJS.
I get all this data from a json file, and I am using the following function to format and color the key pair type values:
const chalk = require('chalk')
function keyValue(key, value) {
return chalk.green(key) + ": " + chalk.yellow(value)
}
This all needs to be in the terminal, and preferably not using node-curses or blessed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了一个非常低效且肿的解决方案:
如果您喜欢注释:
预览:
I found a very inefficient and bloated solution:
if you like comments:
Preview: