
ASCII Printer is a lightweight JavaScript library that prints colorful ASCII art directly into the devtool console.
It packs a catalog of over 100 pieces organized into categories like animals, characters, things, and messages.
Each piece comes with its own predefined color, and you can override colors with any valid CSS color value.
Features:
- Select art by exact name, catalog ID, or a partial name search.
- Pick random art from the entire catalog or filter by category.
- Retrieve catalog metadata and art objects without printing.
- Override default colors with any CSS color value.
- Expose the full art catalog for programmatic access.
- Zero dependencies and a single global namespace.
Use Cases:
- Print a random animal ASCII art as a console greeting when a portfolio site loads.
- Add a hidden developer easter egg that types “hello world” in colored ASCII when a specific command runs.
- Use category-filtered random art to make staging environment logs visually stand out.
- Display a warning message ASCII with a red color override to emphasize important console alerts.
How To Use It
Installation
Copy build/ascii-printer.min.js into your project and load it before scripts that call the global API.
<script defer src="/assets/js/ascii-printer.min.js"></script> <script defer src="/assets/js/site-console.js"></script>
Basic Usage
Call printByName() with an exact catalog name.
// site-console.js
AsciiPrinter.printByName("rocket");
The console prints the selected artwork with its catalog color.
More Examples
Print a developer welcome message
A hidden console greeting works well for product demos, portfolios, and developer-focused landing pages. Set credits to true when you want the console to show the listed ASCII artist after the artwork.
AsciiPrinter.printByName("welcome", {
color: "MediumSpringGreen",
credits: true
});
Find art from part of a name
A partial lookup helps when you know the subject but not the exact catalog entry. printBySearch() prints the first matching item, so use exact names for fixed production output.
AsciiPrinter.printBySearch("bird", {
color: "DeepSkyBlue"
});
Rotate status art from a controlled list
A custom list keeps random output relevant to a page state or console message. Repeated names increase the chance that an item appears.
const deploymentMessages = [
"loading",
"production",
"warning",
"rocket"
];
AsciiPrinter.printRandomFrom(deploymentMessages, {
credits: true
});
Inspect catalog entries before printing
List methods return lightweight metadata for category pickers and debug tools. Get methods return the full object, including the ASCII text, default color, height, and author.
const objects = AsciiPrinter.list("thing");
console.table(objects);
const selectedArt = AsciiPrinter.getByName("lightBulb");
console.log(selectedArt.art);
console.log(selectedArt.author);
API Methods
// Print one catalog item by numeric ID.
AsciiPrinter.printById(84);
// Print one catalog item by its exact name.
AsciiPrinter.printByName("pinkPanther");
// Print the first item whose name contains the search text.
AsciiPrinter.printBySearch("panther");
// Print a random item from the complete catalog.
AsciiPrinter.printRandom();
// Print a random item from one category.
AsciiPrinter.printRandom("animal");
// Print a random item from a custom name list.
AsciiPrinter.printRandomFrom(["heart", "key", "lightBulb"]);
// Return all available categories.
AsciiPrinter.listTypes();
// Return all catalog names.
AsciiPrinter.listNames();
// Return names from one category.
AsciiPrinter.listNames("character");
// Return metadata for all catalog entries.
AsciiPrinter.list();
// Return metadata from one category.
AsciiPrinter.list("message");
// Return a complete ASCII object by ID.
AsciiPrinter.getById(17);
// Return a complete ASCII object by exact name.
AsciiPrinter.getByName("frog");
// Read the current library version.
AsciiPrinter.version;
// Read the complete catalog array.
AsciiPrinter.catalog;
ASCII Art Catalog:
Use the exact name value with AsciiPrinter.printByName() or AsciiPrinter.getByName(). Use the numeric ID with AsciiPrinter.printById() or AsciiPrinter.getById().
Animals
| ID | Name | Default Color | Height | Author |
|---|---|---|---|---|
| 0 | anteater | LightSlateGray | 7 | Veronica Karlsson |
| 1 | armadillo | RosyBrown | 7 | Seal do Mar |
| 2 | bat | DimGray | 7 | Joan G. Stark |
| 3 | bear | Brown | 10 | Joan G. Stark |
| 4 | bees | Goldenrod | 9 | Joan G. Stark |
| 5 | beaver | DarkGoldenrod | 7 | Joan G. Stark |
| 6 | bug | DarkGoldenrod | 6 | Unknown |
| 7 | cat | DarkSlateGrey | 12 | Unknown |
| 8 | caterpillar | Green | 3 | Joan G. Stark |
| 9 | crab | Red | 8 | Unknown |
| 10 | crocodile | OliveDrab | 9 | Shanaka Dias |
| 11 | deer | Tan | 15 | Unknown |
| 12 | dog | Tan | 8 | Unknown |
| 13 | duck | DarkGray | 7 | Unknown |
| 14 | elephant | Silver | 11 | Hamilton Furtado |
| 15 | flamingo | Pink | 13 | Unknown |
| 16 | fox | DarkOrange | 9 | Unknown |
| 17 | frog | SpringGreen | 6 | Unknown |
| 18 | goldfish | Gold | 6 | Unknown |
| 19 | hippo | DarkGray | 7 | Unknown |
| 20 | hedgehog | Tan | 5 | Unknown |
| 21 | lion | Peru | 13 | Joan G. Stark |
| 22 | marbles | Brown | 10 | Unknown |
| 23 | marmot | DarkGoldenrod | 12 | Hayley Jane Wakenshaw |
| 24 | monkey | Brown | 12 | Joan G. Stark |
| 25 | mouse | Gray | 5 | Unknown |
| 26 | parrot | DodgerBlue | 16 | Unknown |
| 27 | pig | Pink | 9 | Unknown |
| 28 | pinguin | Black | 6 | Unknown |
| 29 | snail | SeaGreen | 5 | Hayley Jane Wakenshaw |
| 30 | teckel | Chocolate | 8 | Hayley Jane Wakenshaw |
| 31 | turtle | LimeGreen | 6 | Unknown |
| 32 | wasp | Yellow | 5 | Stef00 |
| 33 | whale | RoyalBlue | 6 | Riitta Rasimus |
Characters
| ID | Name | Default Color | Height | Author |
|---|---|---|---|---|
| 34 | alien | Green | 9 | Joan G. Stark |
| 35 | bender | Silver | 16 | Silver Saks |
| 36 | bigBird | Yellow | 16 | Unknown |
| 37 | cheshireCat | Violet | 6 | Randy Ransom |
| 38 | cookieMonster | Blue | 6 | Randy Ransom |
| 39 | devil | Red | 6 | Joan G. Stark |
| 40 | einstein | Silver | 9 | Joan G. Stark |
| 41 | flintstones | DarkOrange | 11 | Unknown |
| 42 | garfield | Orange | 12 | Joan G. Stark |
| 43 | homer | Gold | 14 | Joan G. Stark |
| 44 | kermit | SpringGreen | 13 | Joan G. Stark |
| 45 | knight | Silver | 10 | Joan G. Stark |
| 46 | maryPoppins | Black | 17 | Unknown |
| 47 | monaLisa | Sienna | 17 | Unknown |
| 48 | pinkPanther | Pink | 12 | Unknown |
| 49 | r2d2 | Blue | 8 | snd |
| 50 | robot | Blue | 14 | Joan G. Stark |
| 51 | santaClaus | Red | 10 | B.D.S. “Don” McConnell |
| 52 | sherlockHolmes | MediumSeaGreen | 8 | Harry Mason |
| 53 | snoopy | Black | 15 | Win Kang |
| 54 | sonic | Blue | 9 | Unknown |
| 55 | spaceInvader | Chartreuse | 8 | Unknown |
| 56 | squidward | Gray | 15 | LGB |
| 57 | tweetieBird | Orange | 9 | Unknown |
| 58 | yosemiteSam | Red | 13 | Unknown |
Things
| ID | Name | Default Color | Height | Author |
|---|---|---|---|---|
| 59 | alarm | Chocolate | 10 | Joan G. Stark |
| 60 | anchor | SlateGray | 10 | Joan G. Stark |
| 61 | axe | SlateGray | 10 | Harry Mason |
| 62 | boat | Aqua | 5 | Hayley Jane Wakenshaw |
| 63 | bomb | DimGray | 14 | Joan G. Stark |
| 64 | book | SaddleBrown | 10 | Joan G. Stark |
| 65 | cake | Pink | 10 | Laura Brown |
| 66 | camera | Gray | 7 | Joan G. Stark |
| 67 | coffee | Brown | 9 | H.P. Barmario |
| 68 | crown | Gold | 10 | Joan G. Stark |
| 69 | electricGuitar | Red | 14 | Rowan Crawford |
| 70 | floppyDisk | DarkSlateGray | 10 | Robert Craggs |
| 71 | flower | Pink | 7 | Joan G. Stark |
| 72 | folder | Orange | 7 | Joan G. Stark |
| 73 | frontDoor | Brown | 12 | Hayley Jane Wakenshaw |
| 74 | gift | Red | 5 | Laura Brown |
| 75 | gun | Silver | 6 | Unknown |
| 76 | heart | Red | 5 | Bungle |
| 77 | hotAirBalloon | Red | 15 | Joan G. Stark |
| 78 | impossibleTriangle | Gold | 17 | Ojosh!ro |
| 79 | impossibleTrident | Gold | 15 | P.J. LaBrocca |
| 80 | key | Gold | 5 | Hayley Jane Wakenshaw |
| 81 | lightBulb | Goldenrod | 7 | Joan G. Stark |
| 82 | mailbox | Red | 12 | Joan G. Stark |
| 83 | plane | Red | 8 | Joan G. Stark |
| 84 | rocket | OrangeRed | 9 | Joan G. Stark |
| 85 | stopSign | Red | 8 | Joan G. Stark |
| 86 | sword | Gold | 7 | Veronica Karlsson |
| 87 | teapot | Sienna | 11 | Stephane Abello |
| 88 | television | SlateGray | 14 | Joan G. Stark |
| 89 | thumbsUp | Goldenrod | 7 | Sebastian Stöcker |
| 90 | tombstone | Gray | 5 | Hayley Jane Wakenshaw |
Messages
| ID | Name | Default Color | Height | Author |
|---|---|---|---|---|
| 91 | bravo | MediumPurple | 4 | Unknown |
| 92 | bye | MediumPurple | 4 | Unknown |
| 93 | dev | MediumPurple | 4 | Unknown |
| 94 | error | Red | 4 | Unknown |
| 95 | hello | DeepSkyBlue | 4 | Unknown |
| 96 | helloWorld | DeepSkyBlue | 4 | Unknown |
| 97 | info | DeepSkyBlue | 4 | Unknown |
| 98 | loading | DeepSkyBlue | 4 | Unknown |
| 99 | production | LimeGreen | 4 | Unknown |
| 100 | stage | DarkOrange | 4 | Unknown |
| 101 | warning | DarkOrange | 4 | Unknown |
| 102 | welcome | DeepSkyBlue | 4 | Unknown |
Alternatives:
- Beautiful Browser Console Output Using Tailwind CSS – twlog
- Add Custom Colors And Styles To Console Logs With Colorlog.js
- Create Stylized Console Logs – Logger.js
FAQs:
Q: Does ASCII Printer add anything to the visible webpage?
A: No. The library writes output to the browser console only. It does not create DOM elements or load a stylesheet.
Q: How do I find the correct ASCII art name?
A: Run AsciiPrinter.listNames() for all names or pass a category such as "animal" or "message". Use AsciiPrinter.list() when you also need numeric IDs and category metadata.
Q: What happens when I use an unknown name or ID?
A: Print methods show a console warning and stop. getById() and getByName() return null when no catalog entry matches.
Q: Can I use ASCII Printer on a production site?
A: Yes. The script adds no visible elements to the page and only writes to the console. It is lightweight enough for easter eggs or branding messages in production.
Q: The ASCII art looks broken or misaligned in my console. How can I fix it?
A: The library relies on a monospace font. Open your browser’s console settings and switch the font to a monospaced family such as Consolas, Courier New, or Monaco.







