This is an npm wrapper for the popular dadjokes api. This wrapper makes it easy to use the dadjokes api with full typecript support
Using npm:
npm install @dadjokes-io/dad-jokes
Using yarn:
yarn add @dadjokes-io/dad-jokes
Note : you must have a rapid-api-key to use this package and you must subscriped to the api
import DadJokes from '@dadjokes-io/dad-jokes';
const dadjokes = new DadJokes('raid-api-key');
Note: all functions from dadjokes are asynchronous
Optional Params -- count
const jokes = await dadjokes.randomJokes(count?:number)
Required Params -- _id
const jokes = await dadjokes.jokeById(_id:string)
Required Params -- type Optional Params -- limit
const jokes = await dadjokes.jokeByType(type:string, limit?:number)
Required Params -- term
const jokes = await dadjokes.searchJoke(term:string)