Socket
Socket
Sign inDemoInstall

pig-latin

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pig-latin

Translate any English text to pig latin (accurately!), because you must be as bored as I am.


Version published
Weekly downloads
7
increased by250%
Maintainers
1
Install size
959 kB
Created
Weekly downloads
 

Readme

Source

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 usage
var piglatin = require('pig-latin')
piglatin(text, options)

Let's see some examples:

var piglatin = require('pig-latin')
piglatin("help help, I can't get up!")

=> '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
piglatin("I am so happy inside")
=> 'iway amway osay appyhay insideway'

// Example 1 - not so crazy
piglatin("I am so happy inside", {vowelEnding: 'ay'})
=> 'iay amay osay appyhay insideay'

// Example 2 - get as crazy as you want
piglatin("I am so happy inside", {vowelEnding: 'juice'})
=> '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.

Keywords

FAQs

Last updated on 22 Apr 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc