A browser demo for testing ASCII Printer directly from the console.
The minified build is already loaded on this page. Open DevTools, paste a command, and use the catalog below for names and IDs.
Version: 1.1.0
Use these commands first to check that the library is available.
AsciiPrinter.printByName("pinkPanther");
AsciiPrinter.printRandom("character");
AsciiPrinter.listNames("animal");
AsciiPrinter.version;
The public API lives under one global object: AsciiPrinter.
AsciiPrinter.printById(), AsciiPrinter.printByName(), AsciiPrinter.printBySearch(), AsciiPrinter.printRandom(), and AsciiPrinter.printRandomFrom() print ASCII art to the console.AsciiPrinter.listTypes(), AsciiPrinter.listNames(), and AsciiPrinter.list() return catalog summaries.AsciiPrinter.getById() and AsciiPrinter.getByName() return one full ASCII entry.AsciiPrinter.version and AsciiPrinter.catalog expose library metadata.Print methods write ASCII art to the browser console. They do not return catalog data.
Use an exact catalog name.
AsciiPrinter.printByName("hello");
AsciiPrinter.printByName("thumbsUp");
Use the numeric ID from the catalog table.
AsciiPrinter.printById(0);
AsciiPrinter.printById(0, { credits: true });
AsciiPrinter.printById(98, { color: "DeepSkyBlue" });
Use a partial name. The first matching ASCII is printed.
AsciiPrinter.printBySearch("rocket");
AsciiPrinter.printBySearch("panther", { color: "HotPink" });
Print from the full catalog, or from one category.
AsciiPrinter.printRandom();
AsciiPrinter.printRandom("animal");
AsciiPrinter.printRandom("message");
Print from a custom list of names. Unknown names are ignored.
AsciiPrinter.printRandomFrom(["heart", "key", "lightBulb"]);
AsciiPrinter.printRandomFrom(["bravo", "warning", "loading"], { credits: true });
Every print method accepts the same optional options object.
AsciiPrinter.printByName("frog", { color: "HotPink" });
AsciiPrinter.printByName("frog", { color: false });
AsciiPrinter.printByName("frog", { credits: true });
AsciiPrinter.printRandom("character", { color: "Gold", credits: true });
color overrides the catalog color with any valid CSS color value. Use false to keep the browser console default color.credits prints the ASCII author after the art. Unknown authors are displayed as Unknown.List methods return catalog summaries without printing ASCII art.
AsciiPrinter.listTypes();
// ["animal", "character", "thing", "message"]
AsciiPrinter.listNames();
AsciiPrinter.listNames("animal");
AsciiPrinter.list();
AsciiPrinter.list("message");
Get methods return one full catalog entry without printing anything.
AsciiPrinter.getById(0);
AsciiPrinter.getByName("pinkPanther");
AsciiPrinter.version;
AsciiPrinter.catalog;
The table below is generated from AsciiPrinter.catalog when the page loads.
AsciiPrinter.listTypes();
AsciiPrinter.listNames();
AsciiPrinter.catalog.length;
| ID | Name | Category | Color | Height | Author | Command |
|---|