Package Exports
- yoo-hoo
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yoo-hoo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Yoo-Hoo
Yoo-Hoo! Its a tiny library for printing a noticeable banner of words for your project. Such as below,
/\\\ /\\\ /\\\\\\\\ /\\\\\\\\ /\\\ /\\\ /\\\\\\\\ /\\\\\\\\
\/\\\ /\\\ /\\\_____/\\\ /\\\_____/\\\ \/\\\ \/\\\ /\\\_____/\\\ /\\\_____/\\\
\/_\\\/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/_\\\\ \/\\\ \/\\\ \/\\\ \/\\\ /\\\\\\\\\ \/\\\\\\\\\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/_______/ \/\\\____/\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/\\\ \/_/\\\\\\\\\ \/_/\\\\\\\\\ \/\\\ \/\\\ \/_/\\\\\\\\\ \/_/\\\\\\\\\
\/_/ \/_______/ \/_______/ \/_/ \/_/ \/_______/ \/_______/
Maybe useful when you want a banner for your project. Have fun!
How to install
npm i yoo-hoo
How to use
import { yo } from 'yoo-hoo';
yo('GOOD');
or in commonjs
const { yo } = require('yoo-hoo');
yo('GOOD');
API
yo(text: string, options?: Option): string[]
It will return the lines for printing. Then you can print it yourself line by line.
Options:
- spacing:
number
The number of spacing between two characters. Default1
. - maxLineWidth:
number
The max length of lines. If exceedmaxLineWidth
following characters will get a line feed. DefaultInfinity
. - color:
string
Setting the color for print. Defaultnone
. There contains several values:random
choosing a random color from the palettenone
with no color setting- any other color string supported by chalk
- silent:
boolean
Whether to prevent print characters when callingyo()
. Defaultfalse
.
For example,
yo('ho', { color: 'blue' });
Then it will print a blue HO
.
Characters Supported
- 26 letters:
A-Z
(letters will be converted to uppercase) - 10 numbers:
0-9
- some punctuations:
·
*
-
|
Characters that are not supported will be ignored.
Run the example
npm run example
/\\\ /\\\ /\\\\\\\\ /\\\\\\\\ /\\\ /\\\ /\\\\\\\\ /\\\\\\\\
\/\\\ /\\\ /\\\_____/\\\ /\\\_____/\\\ \/\\\ \/\\\ /\\\_____/\\\ /\\\_____/\\\
\/_\\\/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/_\\\\ \/\\\ \/\\\ \/\\\ \/\\\ /\\\\\\\\\ \/\\\\\\\\\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/_______/ \/\\\____/\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\ \/\\\
\/\\\ \/_/\\\\\\\\\ \/_/\\\\\\\\\ \/\\\ \/\\\ \/_/\\\\\\\\\ \/_/\\\\\\\\\
\/_/ \/_______/ \/_______/ \/_/ \/_/ \/_______/ \/_______/