@thalorlabs/dadjoke
v1.1.1
Published
Provider adapter for icanhazdadjoke.com — returns TLJoke
Readme
@thalorlabs/dadjoke
Provider adapter for icanhazdadjoke.com. Returns normalised TLJoke from @thalorlabs/types.
Installation
npm install @thalorlabs/dadjokeUsage
import { DadJokeClient, DAD_JOKE_CONFIG } from '@thalorlabs/dadjoke';
const client = new DadJokeClient();
const joke = await client.getJoke();
// → TLJoke { id, type: 'SINGLE', joke: '...', category: 'DAD', safe: true, provider: 'dadjoke' }Configuration
| Option | Default | Description |
|--------|---------|-------------|
| baseURL | https://icanhazdadjoke.com | API base URL |
| timeout | 10000 | Request timeout (ms) |
Exported Config
DAD_JOKE_CONFIG = {
cacheTtlMs: 86400000, // 24h
isBillable: false,
}Scripts
npm run build # tsc → dist/
npm test # vitest
npm run lint # eslint
npm run format:check # prettier