Skip to content

🏴‍☠️ An API wrapper for translating from English to Pirate and generating pirate insults ☠️

License

Notifications You must be signed in to change notification settings

philnash/pirate-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏴‍☠️ Pirate API ☠️

deno npm tests Contributor Covenant

The Pirate Monkeyness API can generate pirate insults and it can translate from English to Pirate.

This is a Deno wrapper for the API that is available as both a Deno module and a Node.js module on npm.

Usage

The Pirate Monkeyness API makes available two APIs; one that creates a pirate insult and one that takes English text as an argument and returns a pirate translation of that text.

Deno

import { insult, translate } from "https://deno.land/x/pirate_api/mod.ts";

console.log(await insult());
// => "I'll gut ye bow to stern, ye dreadful, cowardly mongrel! ... Blow me down!"

console.log(
  await translate("Let's take to the seas for an adventure captain."),
);
// => "Let's take t' the seas fer an adventure cap'n."

Node.js

To use the module in a Node.js application, first install the module with:

npm install pirate-api

You can then use the module in your application like this:

import { insult, translate } from "pirate-api";

console.log(await insult());
// => "Yer face be good fer stoppin' cannonballs, ye scrappy, salty dullard! ... Blow me down!"

console.log(
  await translate("Let's take to the seas for an adventure captain."),
);
// => "Let's take t' the seas fer an adventure cap'n."

You can also use this module as a Common JS require:

const { insult, translate } = require("pirate-api");

console.log(await insult());
// => "It's the locker for ye, ye pitiful, weak-kneed swab! ... Splice the mainbrace!"

console.log(
  await translate("JavaScript is a very versatile language, don't you think?"),
);
// => "JavaScript be a mighty versatile language, don't ye reckon?"

Thanks

Thanks very much to Tim Moses the creator of the Pirate Monkeyness API. It is a free service and it makes me very happy that it exists.

What's a pirate's favourite programming language?

Ye might reckon a pirate's fav'rit programmin' language be R, but his first love be the C!"

About

🏴‍☠️ An API wrapper for translating from English to Pirate and generating pirate insults ☠️

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published