I've built a Node.js CLI interface this weekend to generate themed ASCII art. It supports 287 fonts from Figlet and 18 themes from VS Code.
This all started because of a tweet Wassim did, and I tried to replicate that. I've managed to do a passable version using online tools but it was a manual process. So I tried recreating it in Node.js using Figlet, and the Monokai Dimmed theme from VS Code. I should have stopped here, it was good enough.
But I went too deep down the rabbit hole, so I built a customizable CLI with more than 5000 options to generate ASCII art in the terminal. Enjoy! And do comment below with whatever cool thing you end up generating with it.
Usage
npx ascii-themes generate dev.to
- Optional flags:
-
--font
The Figlet Font to use. Defaults to 'Slant Relief'. -
--themeName
The VS Code theme to use. Defaults to 'Monokai Dimmed'. -
--horizontalLayout
The horizontal layout to use for the Figlet Font. Defaults to 'default'. -
--verticalLayout
The vertical layout to use for the Figlet Font. Defaults to 'default'.
-
Interactive Mode
The CLI has 2 interactive modes:
npx ascii-themes -i
Will allow you to select from the available commands (generate, support, interactive) and input the flags for them via text prompts.
npx ascii-themes interactive
Will allow you to input the text and select from a list of the available fonts, themes, and layouts.
Options
To see supported fonts and themes run npx ascii-themes support
.
Or you can watch this video tweet I did while building the CLI, it shows you all available fonts in one minute.
Does the world need another ASCII Art CLI?16:01 PM - 28 Sep 2019
Top comments (8)
I tried your example and I get this error:
What command did you run?
what's your OS and terminal app? you might have to escape that string.
npx ascii-themes generate 'dev.to'
I'm a Mac OS with Oh My Zsh in the iTerm2:
That is totally weird, the CLI doesn't throw that message, it's from somewhere deeper in the dependencies. I can't reproduce it, can you help me debug it please? Maybe even throw in a PR at github.com/AlexLakatos/ascii-themes
I'm guessing it tries to interpret the
.
indev.to
as regex. What happens if you try some text without the dot, likenpx ascii-themes generate "devto"
Works great.
You've ruined my life!
Oh, I've got an update planned for this weekend, stay tuned :D