yodasay

1.1.12 • Public • Published

yodasay

 ________________________
< Use yodasay, you will. >
 ------------------------
      \
       \
          .--.
  \`--._,'.::.`._.--'/
    .  ` __::__ '  .
      -:.`'..`'.:-
        \ `--' /
          ----

yodasay is a talking yoda (plus other Star Wars characters)!

This project is a fork of https://github.com/piuccio/cowsay. The ASCII art was taken from Christopher Johnson's website.

Install

npm i -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.

TIP: Pipe the output through lolcatjs for an awesome effect.

Multi-color Yoda 0

Multi-color Dark Vader 0

Multi-color Dark Vader 1

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`
  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"
});

Package Sidebar

Install

npm i yodasay

Weekly Downloads

439

Version

1.1.12

License

MIT

Unpacked Size

18.7 kB

Total Files

19

Last publish

Collaborators

  • scotttesler-user