1.0.0 • Published 3 months ago

chucklejs v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Installation

Use the install command of your favourite package manager!

e.g.

npm install chucklejs

Usage

Simply import which ever utilities you would like to use

e.g.

import { getJoke } from "chucklejs";

try {
  console.log(
    await getJoke(["Programming", "Dark", "Pun"], {
      blacklistFlags: ["nsfw", "racist", "explicit"],
      types: ["twopart"],
    })
    /*  [
            {
                category: "Programming",
                type: "twopart",
                setup: "why do python programmers wear glasses?",
                delivery: "Because they can't C.", 🤣🤣🤣
            }
        ]
    */
    ]
  );
} catch (error) {
  /* Error Handling */
}

Docs

function getJoke(
  categories: Category[] | undefined,
  { blacklistFlags, amount, language, contains, types }: Options
): Promise<
  (
    | {
        category: Category;
        type: "single";
        joke: string;
      }
    | {
        category: Category;
        type: "twopart";
        setup: string;
        delivery: string;
      }
  )[]
>;
1.0.0

3 months ago

0.0.1

3 months ago