@ffflorian/icanhazdadjoke
TypeScript icon, indicating that this package has built-in type declarations

2.2.8 • Public • Published

ICanHazDadJoke npm version

An ICanHazDadJoke API client with a CLI.

Usage

A complete documentation is available at https://ffflorian.github.io/api-clients/packages/icanhazdadjoke/.

CLI

To use ICanHazDadJoke globally, run yarn global add @ffflorian/icanhazdadjoke or npm i -g @ffflorian/icanhazdadjoke.

Usage: icanhazdadjoke [options] [command]

An icanhazdadjoke.com API client with a CLI.

Options:
  -v, --version       output the version number
  -o, --output <dir>  Specify the output directory (default: current directory)
  -i, --image         Save the joke as image
  -s, --silent        Don't output save messages
  -h, --help          output usage information

Commands:
  random              Fetch a random dad joke
  id <id>             Fetch a dad joke by ID

Installation

Run yarn add @ffflorian/icanhazdadjoke or npm install @ffflorian/icanhazdadjoke.

Example

import {ICanHazDadJoke} from '@ffflorian/icanhazdadjoke';

const iCanHazDadJoke = new ICanHazDadJoke();

iCanHazDadJoke.api.getRandom().then(result => {
  // JokeResult
});

iCanHazDadJoke.api.getById('R7UfaahVfFd').then(result => {
  // JokeResult
});

iCanHazDadJoke.api.getRandom({withImage: true}).then(result => {
  // JokeResultWithImage
});

iCanHazDadJoke.api.getById('R7UfaahVfFd', {withImage: true}).then(result => {
  // JokeResultWithImage
});

iCanHazDadJoke.api.search('dog').then(result => {
  // JokeSearchResult
});

iCanHazDadJoke.api.search({term: 'dog', limit: 5}).then(result => {
  // JokeSearchResult
});

iCanHazDadJoke.api.search('dog', {limit: 5}).then(result => {
  // JokeSearchResult
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.2.81latest

Version History

VersionDownloads (Last 7 Days)Published
2.2.81
2.2.70
2.2.60
2.2.50
2.2.40
2.2.30
2.2.21
2.2.10
2.2.00
2.1.10
2.1.00
2.0.60
2.0.50
2.0.40
2.0.30
2.0.20
2.0.10
2.0.00
1.3.00
1.2.10
1.2.00
1.1.120
1.1.110
1.1.100
1.1.90
1.1.80
1.1.70
1.1.60
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00

Package Sidebar

Install

npm i @ffflorian/icanhazdadjoke

Weekly Downloads

2

Version

2.2.8

License

GPL-3.0

Unpacked Size

54.9 kB

Total Files

18

Last publish

Collaborators

  • ffflorian