You're probably sitting there right now thinking, "My project would be so much better if the text were in a childish pseudo-language that is difficult to understand."
I was thinking the same thing too (about your project I mean). So I wrote this package for you.
Installation
npm install pig-latin
Version 2.0
Now with better capitalization support (see below)! Now with EVEN. MORE. BACON.
Capitalization support
We no longer have the 'capitalize' option. Instead, it simply maintains any capitalized word that you send to it.
Usage
Tired of pig-latin packages that don't actually work? We're not messing around here. This package includes:
- ACCURATE translation of words that start with vowels (with options, because some of you are crazy)
- ACCURATE dealing with punctuation (mostly -- I'm sure if you really tried you could break it)
// Generic usagevar piglatin =
Let's see some examples:
var piglatin = 'elphay elphay, iway antcay etgay upway!'
Options
This module takes an options object, which currently supports two options:
vowelEnding
Apparently everyone in the world uses a different ending for words that start with vowels. By default it is "-way", but you can set it to any string here you'd like.
// Default 'iway amway osay appyhay insideway' // Example 1 - not so crazy 'iay amay osay appyhay insideay' // Example 2 - get as crazy as you want 'ijuice amjuice osay appyhay insidejuice' // NOTE: this option only affects words that start with vowels
Items to note
- Does not support dashes. Those will be removed and replaced with commas.