Socket
Socket
Sign inDemoInstall

dadjokes-wrapper

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dadjokes-wrapper

NodeJS wrapper for the ICanHazDadJokes API


Version published
Weekly downloads
16
decreased by-23.81%
Maintainers
1
Install size
4.47 MB
Created
Weekly downloads
 

Readme

Source

dadjokes-wrapper

Travis npm npm

NodeJS wrapper for the ICanHazDadJokes API

This module will help you to get some nice Dad Jokes !

Usage

const DadJokes = require('dadjokes-wrapper');
const dj = new Dadjokes();

dj.randomJoke()
  .then(res => console.log(res))
  .catch(err => console.error(err));

exemple of output

Two guys walked into a bar, the third one ducked.

API

const DadJokes = require('dadjokes-wrapper');
const dj = new Dadjokes();

dj.randomJoke()
  .then(res => console.log(res))
  .catch(err => console.error(err));
// Returns a random joke

dj.randomSlackJoke()
  .then(res => console.log(res))
  .catch(err => console.error(err));
// Returns a random joke formatted for slack

dj.jokeById('R7UfaahVfFd') 
  .then(res => console.log(res))
  .catch(err => console.error(err));
// This method is auto-cached and returns a joke by it's id

dj.jokeImgById('gNu41gNeqjb')
  .then(res => res)
  .catch(err => console.error(err)); 
// Returns an image of the joke

dj.searchJoke()
  .then(res => console.log(res))
  .catch(err => console.error(err));
// Look here for the query parameters available
// https://icanhazdadjoke.com/api#search-for-dad-jokes

Install

With npm installed, run

$ npm install dadjokes-wrapper

Or with yarn installed, run

$ yarn add dadjokes-wrapper

See Also

License

MIT

Keywords

FAQs

Last updated on 28 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc