___ _____ _____ _____ _____ ______ _ _ / _ \/ ___/ __ \_ _|_ _| | ___ \ (_) | | / /_\ \ `--.| / \/ | | | | | |_/ / __ _ _ __ | |_ ___ _ __ | _ |`--. \ | | | | | | __/ '__| | '_ \| __/ _ \ '__| | | | /\__/ / \__/\_| |_ _| |_ | | | | | | | | | || __/ | \_| |_|____/ \____/\___/ \___/ \_| |_| |_|_| |_|\__\___|_|

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

Quick start

Use these commands first to check that the library is available.

AsciiPrinter.printByName("pinkPanther");
AsciiPrinter.printRandom("character");
AsciiPrinter.listNames("animal");
AsciiPrinter.version;

API

The public API lives under one global object: AsciiPrinter.

Print

Print methods write ASCII art to the browser console. They do not return catalog data.

Print by name

Use an exact catalog name.

AsciiPrinter.printByName("hello");
AsciiPrinter.printByName("thumbsUp");

Print by ID

Use the numeric ID from the catalog table.

AsciiPrinter.printById(0);
AsciiPrinter.printById(0, { credits: true });
AsciiPrinter.printById(98, { color: "DeepSkyBlue" });

Print by search

Use a partial name. The first matching ASCII is printed.

AsciiPrinter.printBySearch("rocket");
AsciiPrinter.printBySearch("panther", { color: "HotPink" });

Print random

Print from the full catalog, or from one category.

AsciiPrinter.printRandom();
AsciiPrinter.printRandom("animal");
AsciiPrinter.printRandom("message");

Print random from names

Print from a custom list of names. Unknown names are ignored.

AsciiPrinter.printRandomFrom(["heart", "key", "lightBulb"]);
AsciiPrinter.printRandomFrom(["bravo", "warning", "loading"], { credits: true });

Print options

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 });

List

List methods return catalog summaries without printing ASCII art.

List types

AsciiPrinter.listTypes();
// ["animal", "character", "thing", "message"]

List names

AsciiPrinter.listNames();
AsciiPrinter.listNames("animal");

List metadata

AsciiPrinter.list();
AsciiPrinter.list("message");

Get

Get methods return one full catalog entry without printing anything.

Get by ID

AsciiPrinter.getById(0);

Get by name

AsciiPrinter.getByName("pinkPanther");

Metadata

AsciiPrinter.version;
AsciiPrinter.catalog;

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