1.0.1 • Published 2 years ago

pirate-api v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Pirate API

tests Contributor Covenant

This is a Deno wrapper for the Pirate Monkeyness API that is also available as an npm module.

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, trnaslate } from "https://deno.land/x/pirate-api/mod.ts";

console.log(await insult());

console.log(await translate("Let's take to the seas for an adventure."));

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());

console.log(await translate("Let's take to the seas for an adventure."));

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

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

console.log(await insult());

console.log(
  await translate(
    "JavaScript truly is a very versatile language, don't you think?",
  ),
);

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.