项目作者: spudly

项目描述 :
🏴‍☠️ Translates text into pirate-speek
高级语言: JavaScript
项目地址: git://github.com/spudly/talk-like-a-pirate.git
创建时间: 2014-11-13T13:47:37Z
项目社区:https://github.com/spudly/talk-like-a-pirate

开源协议:MIT License

下载


talk-like-a-pirate

Translates text into pirate-speak.

Installation

  1. npm install talk-like-a-pirate

Usage (node)

Yonder module exports a function, so all ye have to do be require it in and
execute it. Pass it a string and it will translate it into pirate-lingo for ye.

  1. var talkLikeAPirate = require('talk-like-a-pirate');
  2. console.log(talkLikeAPirate('Hello!'));

Usage (web browser)

All ye have to do here be load ye JavaScript file (use yonder
talk-like-a-pirate.js file for web browsers). It puts talkLikeAPirate
on thar window object, so ye just have to call ye function.

  1. <script src='talk-like-a-pirate.js'></script>
  2. <script>
  3. alert(talkLikeAPirate('Hello!'));
  4. </script>

… or use requirejs.

  1. require.config({
  2. paths: {
  3. 'talk-like-a-pirate': '/path/to/talk-like-a-pirate'
  4. }
  5. });
  6. require(['talk-like-a-pirate'], function(talkLikeAPirate) {
  7. alert(talkLikeAPirate('Hello!'));
  8. });

… or better still, use ye node usage described above and
browserify it.