Print anything on terminal with beautiful patterns
The package allows users to print letters, shapes, animals, and Moods on the terminal with ASCII art patterns and in different colors. It can be installed via npm and can be used in JavaScript or TypeScript by importing the package and calling the appropriate functions with the desired color.
- Print letters with
anyLog
- Print shapes with
anyShape
- Print animals with
anyAnimal
- Print moods with
anyMood
- Support for 16 different colors
- TypeScript support with type definitions
- CommonJS and ES Module support
To install the package, run the following command in your terminal:
npm i any-pattern
const anyPattern = require("any-pattern");
anyPattern.anyLog("Hello", "red");
anyPattern.anyShape("heart", "blue");
anyPattern.anyAnimal("cat", "yellow");
anyPattern.anyMood("smiley", "green");
import { anyLog, anyShape, anyAnimal, anyMood } from 'any-pattern';
anyLog("Hello", "red");
anyShape("heart", "blue");
anyAnimal("cat", "yellow");
anyMood("smiley", "green");
Print text using ASCII art letters with the anyLog
function.
import { anyLog } from 'any-pattern';
// Print "Hello" in red
anyLog("Hello", "red");
// Print "World" in blue (default color is white)
anyLog("World");
All letters from A to Z (case-insensitive)
Print various shapes with the anyShape
function.
import { anyShape } from 'any-pattern';
// Print a heart in red
anyShape("heart", "red");
// Print a diamond in blue
anyShape("diamond", "blue");
- Square
- Hollow Square
- Diamond
- Heart
- Star
- Triangle
- Hollow Triangle
- Pyramid
- Hollow Pyramid
- Plus
- Cross
- Arrow
- Circle
- Hollow Circle
Print cute ASCII art animals with the anyAnimal
function.
import { anyAnimal } from 'any-pattern';
// Print a cat in blue
anyAnimal("cat", "blue");
// Print a dog in yellow
anyAnimal("dog", "yellow");
- Cat
- Dog
- Fish
- bat
- Rabbit
- Monkey
- Elephant
- scorpion
Print expressive ASCII art Moods with the anyMood
function.
import { anyMood } from 'any-pattern';
// Print a smiley face in yellow
anyMood("smiley", "yellow");
// Print a sad face in blue
anyMood("sad", "blue");
- Smiley
- Sad
- Angry
- Surprised
- Wink
- Cool
- Sleepy
- Nerd
- Robot
- Alien
All functions support the following colors:
- black
- red
- green
- yellow
- blue
- magenta
- cyan
- white
- gray
- redBright
- greenBright
- yellowBright
- blueBright
- magentaBright
- cyanBright
- whiteBright
import { anyLog, anyShape, anyAnimal, anyMood } from 'any-pattern';
// Print a message
anyLog("Welcome to the Zoo!", "green");
// Print some animals
anyAnimal("lion", "yellow");
anyAnimal("elephant", "gray");
anyAnimal("monkey", "brown");
// Add some Moods
anyMood("smiley", "yellow");
anyMood("cool", "blue");
Contributions are welcome! Please feel free to submit a Pull Request.
MIT © Diyon Finesco