yodasay-extended
v1.0.1
Published
yodasay is a configurable talking Yoda
Downloads
18
Maintainers
Readme
yodasay
________________________
< Use yodasay, you will. >
------------------------
\
\
.--.
\`--._,'.::.`._.--'/
. ` __::__ ' .
-:.`'..`'.:-
\ `--' /
----
yodasay is a configurable talking yoda, originally written in Perl by Tony Monroe and then re-written in Node.js by Fabio Crisci.
This project is a fork of https://github.com/piuccio/cowsay. The Yoda ASCII art was taken from Christopher Johnson's website.
Install
npm install -g yodasay
Usage
yodasay JavaScript FTW!
or
yodathink Node.js is cool
It acts in the same way as cowsay, so consult yodasay(1)
or run yodasay -h
________
< indeed >
--------
\
\
.-.
|_:_|
/(_Y_)\
( \/M\/ )
'. _.'-/'-'\-'._
': _/.--'[[[[]'--.\_
': /_' : |::"| : '.\
': // ./ |oUU| \.' :\
': _:'..' \_|___|_/ : :|
':. .' |_[___]_| :.':\
[::\ | : | | : ; : \
'-' \/'.| |.' \ .;.' |
|\_ \ '-' : |
| \ \ .: : | |
| \ | '. : \ |
/ \ :. .; |
/ | | :__/ : \\
| | | \: | \ | ||
/ \ : : |: / |__| /|
snd | : : :_/_| /'._\ '--|_\
/___.-/_|-' \ \
'-'
Usage as a module
yodasay can be used as any other npm dependency
var yodasay = require('yodasay');
console.log(yodasay.say({
text : 'Use yodasay, you will.'
}));
// or yodasay.think()
Pipe from standard input
echo please repeat | yodasay
Usage in the browser
yodasay works in your browser too with rollup / webpack / browserify / you name it.
import { say } from 'yodasay';
console.log(say({ text: 'meditating in the browser' }));
You can customize the character by importing the relevant one
import { think, R2D2 } from 'yodasay';
console.log(think({
text: 'meditating in the browser',
cow: R2D2,
eyes: 'pp',
tongue: ';;'
}));
All characters are included in the bundle, but you can use rollup / webpack tree-shake feature to reduce the final bundle size.
Browser options
say({
text: 'hello',
cow: '', // Template for a character, get inspiration from `./cows`
eyes: 'oo', // Select the appearance of the character's eyes, equivalent to yodasay -e
tongue: 'L|', // The tongue is configurable similarly to the eyes through -T and tongue_string, equivalent to yodasay -T
wrap: false, // If it is specified, the given message will not be word-wrapped. equivalent to yodasay -n
wrapLength: 40, // Specifies roughly where the message should be wrapped. equivalent to yodasay -W
mode: 'b', // One of "b", "d", "g", "p", "s", "t", "w", "y"
});