Made in 2019

ASCII Printer

JS script that print ASCII art in the console

Javascript bundle that I use in every project I make. It prints some ASCII arts in the browser console.

Context

I wanted to display some ASCII arts in the console as easter eggs, and I wanted to do in a single line. So I created this script.

Result

Every art has a color associated with it.

ASCII Printer Screenshot

So what can this Javascript modul can do?

Print by Name

Input

printAsciiByName("pinkPanther");

Output

 .--.             .--.
( ('\\.---------.//') )
 '-.    __   __    .-'
  /    /__\ /__\    \
 |     \ 0/ \ 0/     |
  \     _/   \_     /
   '-.  /-"""-\  .-'
     /  '.___.'  \
     \     I     /
      ';--'''--;'
        '.___.'
          | |

Print by Id

This function is useful when you want to add random in this script.

Input

printAsciiById(18);

Output

                        .
                        | \/|
(\   _                  ) )|/|
    (/            _----. /.'.'
.-._________..      .' @ _\  .'
'.._______.   '.   /    (_| .')
  '._____.  /   '-/      | _.'
   '.______ (         ) ) \
     '..____ '._       )  )
        .' __.--\  , ,  // ((
        '.'     |  \/   (_.'(
                |   \ .'
                 \   (
                  \   '.
                   \ \ '.)
                    '-'-'

Print randomly

Input

printAsciiRandom();

Output

     .--'''''''''--.
   '      .---.      '.
 /    .-----------.    \
/        .-----.        \
|       .-.   .-.       |
|      /___\ /___\      |
 \    | .-. | .-. |    /
  '-._| | | | | | |_.-'
      | '-' | '-' |
       \___/ \___/
    _.-'  /   \  '-._
  .' _.--|     |--._ '.
  ' _...-|     |-..._ '
         |     |
         '.___.'

…and more on the Github!

tetris cube icon

Wow, that's some serious craftmanship Thomas!