An open API service indexing awesome lists of open source software.

https://github.com/11xdeveloper/chucklejs


https://github.com/11xdeveloper/chucklejs

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          



🤣 chucklejs



As you can tell, we can't afford a logo designer (Yes, that's Comic Sans 🤣)



Downloads: /week


bundle size

module formats: cjs, esm

---

## Installation

Use the `install` command of your favourite package manager!

e.g.

```bash
npm install chucklejs
```

---

## Usage

Simply import which ever utilities you would like to use

e.g.

```ts
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

```ts
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;
}
)[]
>;
```