Last updated
What Is ASCII Art?
ASCII art uses printable characters from the ASCII character set to create visual representations of text, images, and patterns. ASCII banners specifically use large character arrangements to spell out text in a visually striking way. They're commonly used in terminal applications, README files, startup messages, and code comments to display application names or section headers.
ASCII Font Styles
| Font | Example (letter A) | Use Case |
|---|---|---|
| Standard | Multi-line block letters | General purpose |
| Big | Larger block letters | Headers, titles |
| Slant | Italicized block letters | Stylized logos |
| 3D | Three-dimensional effect | Dramatic headers |
| Banner | Wide, flat letters | Terminal banners |
| Block | Solid filled letters | Bold statements |
Generating ASCII Art with figlet
// Using figlet.js in Node.js
import figlet from 'figlet';
figlet('Hello World!', {
font: 'Standard',
horizontalLayout: 'default',
verticalLayout: 'default',
width: 80,
whitespaceBreak: true
}, (err, data) => {
if (err) { console.error(err); return; }
console.log(data);
});
// Output:
// _ _ _ _ __ __ _ _ _
// | | | | ___| | | ___ \ \ / /__ _ __| | __| | |
// | |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
// | _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
// |_| |_|\___|_|_|\___/ \_/\_/ \___/|_| |_|\__,_(_)
ASCII Art in README Files
ASCII banners in README files are a popular way to make projects stand out on GitHub. Place the banner at the top of the README inside a code block to preserve formatting. Keep banners under 80 characters wide for compatibility with narrow terminals.