On one of the millions websites I noticed big word in the console written with symbols. Which lib is that or how to do that? Cuz I have no idea.
Asked
Active
Viewed 57 times
-2
-
There are several generators online to make a word out of multiple characters to make it big like that (related: ascii art). The colors are done with a css like syntax, see https://stackoverflow.com/q/7505623/12101554 – Samathingamajig Jul 14 '23 at 18:29
-
Does this answer your question? https://stackoverflow.com/questions/64381195/how-do-you-input-an-ascii-art-image-into-the-console-in-js – fordat Jul 14 '23 at 18:30
-
https://patorjk.com/software/taag/#p=display&f=Graffiti&t=Hello – hakki Jul 14 '23 at 18:36
2 Answers
1
You have to use an ASCII generator, then wrap it using Template literals (Template strings), and then style it using CSS.
console.log(`%c
.d888 d8b 888 d8b
d88P" Y8P 888 Y8P
888 888
888888 888 888d888 .d88b. .d8888b 88888b. 888 88888b.
888 888 888P" d8P Y8b 88K 888 "88b 888 888 "88b
888 888 888 88888888 "Y8888b. 888 888 888 888 888
888 888 888 Y8b. X88 888 888 888 888 d88P
888 888 888 "Y8888 88888P' 888 888 888 88888P"
888
888
888 `,"font-family:monospace; color: orange;");
This may not work in Stack Snippet, but it should work locally.

Sally loves Lightning
- 952
- 16
-1
You can do this with a template literal, using backticks.
console.log(` _ _ _ _
| | | | | | |
| |__| | ___| | | ___
| __ |/ _ \ | |/ _ \
| | | | __/ | | (_) |
|_| |_|\___|_|_|\___/
`);
-
1
-
It'll result in `Uncaught SyntaxError: '' string literal contains an unescaped line break`. – Sally loves Lightning Jul 14 '23 at 18:45