A lightweight Node.js package for printing beautiful patterns and names in ASCII art using asterisks (*) in the terminal.
npm install terminal-pattern
const patternPrinter = require('terminal-pattern');
// Print a simple pattern
patternPrinter.printTrinangle('hollow', 5);
// Print your name in ASCII art
patternPrinter.printName('JOHN');
- 🎨 Multiple pattern types (triangle, square, diamond, pyramid)
- 📝 Convert text/names to ASCII art using asterisks
- 🎯 Customizable pattern sizes
- 🎪 Colorful terminal output support
- 📱 Cross-platform compatibility (Windows, macOS, Linux)
- ⚡ Lightweight with no external dependencies
const { printTriangle } = require('terminal-pattern');
// Print a triangle pattern
printTriangle('solid', 5);
/*
*
***
*****
*******
*********
*/
### Name/Text Printing
```javascript
const { printName } = require('terminal-pattern');
// Print name in ASCII art
printName('HELLO');
/*
** ** ******* ** ** *******
** ** ** ** ** ** **
******* ******* ** ** ** **
** ** ** ** ** ** **
** ** ******* ******* ******* *******
*/
// Print with custom options
printName(name = "LALIT", size = 9, thickness = 1, gap = 2)
Prints a pattern in the terminal.
Parameters:
-
type
(string): Pattern type - 'hollow', 'solid', -
size
(number): Size of the pattern
Prints text as ASCII art in the terminal.
Parameters:
-
name
(string): Text to convert to ASCII art
const printer = require('terminal-pattern');
// Different patterns
printer.printPattern('triangle', 6);
printer.printPattern('square', 8);
printer.printPattern('diamond', 4);
// Colored output
printer.printName('NODEJS', { color: 'green' });
printer.printPattern('triangle', 5, { color: 'blue' });
// Custom characters
printer.printName('REACT', { character: '#', color: 'cyan' });
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Lalit Patharia
- GitHub: (https://github.com/Lalit10122)
- npm: (https://www.npmjs.com/~lalit01)
⭐ If you found this package helpful, please consider giving it a star on GitHub!