https://github.com/11xdeveloper/chucklejs
https://github.com/11xdeveloper/chucklejs
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/11xdeveloper/chucklejs
- Owner: 11xdeveloper
- Created: 2024-02-08T12:46:51.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-08T16:14:32.000Z (about 2 years ago)
- Last Synced: 2025-03-18T18:52:47.774Z (about 1 year ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
## 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;
}
)[]
>;
```