jpiglatin
v1.0.2
Published
JPigLatin is a pig-latin translation and speech synthesis package
Downloads
18
Readme
JPigLatin 🐷
JPigLatin is a simple javaScript package for generating pig latin from plain text. You can see package on npm, github, or see the web application on JPig.org
Installation
- Via CDN
Replace version with current version, i.e 1.0.3
<script src="https://unpkg.com/jpiglatin@VERSION/index.js"></script>
- Via NPM
npm i jPigLatin -save
Use
- Include jPigLatin in page source
<script src="https://unpkg.com/[email protected]/index.js"></script>
- Create two fields, one for user input and one for output
<span id="input">This is a test</span>
<span id="output"></span>
- Use javascript to get pass input to jPigLatin
encode()
function. Set input and output ElementID's with local variables.
<script>
function displayPigLatin(){
var input = "input";
var output = "output";
document.getElementById(output).innerHTML = encode(input,output);
}
</script>
- Use an event loader to execute function
<button onclick="displayPigLatin()">Translate</button>
Contributing
Feel free to make a pull request for features