one-liner-joke

    1.2.2 • Public • Published

    one-liner-joke

    Build Status

    A simple Node Module which can provide one line joke randomly or from specific tag

    This module contains more than 2200 one line jokes.

    Installation

    npm install one-liner-joke --save
    

    Usage

    var oneLinerJoke = require('one-liner-joke');
    
    /*
    The variable getRandomJoke will contain a random joke with a format:
    {"body":"Artificial intelligence is no match for natural stupidity.","tags":["intelligence","stupid"]}
    */
    var getRandomJoke = oneLinerJoke.getRandomJoke();
    console.log(getRandomJoke)
    
    /*
    One can add exclusion filter for the jokes tags
    default is ['racist', 'dirty', 'sex']
    */
    var getRandomJoke = oneLinerJoke.getRandomJoke({
        'exclude_tags': ['dirty', 'racist', 'marriage']
      });
    console.log(getRandomJoke)
    
    
    /*
    The variable getRandomJoke will contain a random joke with a tag and with a format:
    {"body":"Artificial intelligence is no match for natural stupidity.","tags":["intelligence","stupid"]}
    */
    
    var getRandomJokeWithTag = oneLinerJoke.getRandomJokeWithTag('stupid');
    console.log(getRandomJokeWithTag)
    
    /*
    One can add exclusion filter for the jokes tags
    default is ['racist', 'dirty', 'sex']
    */
    var getRandomJoke = oneLinerJoke.getRandomJokeWithTag('stupid', {
      'exclude_tags': ['dirty', 'racist', 'marriage']
    });
    console.log(getRandomJoke)
    
    

    Tests

    npm test
    

    Install

    npm i one-liner-joke

    DownloadsWeekly Downloads

    980

    Version

    1.2.2

    License

    MIT

    Unpacked Size

    307 kB

    Total Files

    8

    Last publish

    Collaborators

    • faiyaz26