A simple Node.js server that streams a live ASCII animation directly to your terminal using curl.
It all started when I discovered the magic command curl -NL party.hotdogstand.lol, which change the color of the terminal with simple ascii color inputs from the server and I decided to create my own version: a fox battling against strong gusts of wind!
There is no dark magic involved, just a clever combination of two standard technologies:
- Chunked Streaming (HTTP): Instead of sending a complete web page and then closing the connection, the Node.js server keeps the connection open (
Connection: keep-alive) and sends the text piece by piece (Transfer-Encoding: chunked). The terminal therefore receives an endless stream of text. - ANSI Escape Sequences: These are invisible codes sent to the terminal.
- They allow text coloring (e.g.,
\x1b[38;5;208mfor the fox's orange color).// the thing that hotdogstand is doing. - The animation Instead of printing thousands of foxes one below the other, this code instructs the terminal to move its cursor back to the top-left corner. Thus, "Frame 2" overwrites "Frame 1", creating a fluid animation much like a flipbook.
- They allow text coloring (e.g.,
If you want to see the fox face the storm on your own computer, follow these steps:
- Node.js installed on your machine.
- A terminal (or command prompt).
- Clone this repository and navigate into the folder:
git clone [https://github.com/ggodefroid/wimd.git](https://github.com/ggodefroid/wimd.git) cd wimd