Giter Site home page Giter Site logo

ashwaniydv / jokesnquotes Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 196 KB

A simple NPM Package which returns random jokes and quotes. Get your daily quote and stay motivated along with a smile! โœŒ๏ธ ๐ŸŒธ

Home Page: https://www.npmjs.com/package/jokesnquotes

License: MIT License

JavaScript 100.00%
npm npm-package npm-packages npm-publish npm-install npm-module npmjs

jokesnquotes's Introduction

jokesnquotes

NPM VERSION GitHub license npm collaborators GitHub issues

A simple NPM Package which returns random jokesnquotes. It provides awesome quotes to display in your application and if your mood is off, it provides jokes with categories. Get your daily quote and stay motivated along with a smile!

GitHub code size in bytes npm GitHub last commit GitHub top language Maintenance

Click here to view this package on NPM registry. Check the homepage here.

Getting started

NPM

$ npm install --save jokesnquotes

Installation

NPM INSTALL NODE JS jokesnquotes

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

Installation is done using the npm install command:

$ npm install jokesnquotes

Usage

usage

Quick review

const jokesnquotes = require('jokesnquotes');

console.log(jokesnquotes.getRandomQuote());
 {  
    "text":"My reputation grows with every failure.",
    "author":"George Shaw"
 }

Full review

var jokesnquotes = require('jokesnquotes');

/*
The variable quote will contain a random quote with a format:
{
   "text":"My reputation grows with every failure.",
   "author":"George Shaw"
}
*/
var quote = jokesnquotes.getRandomQuote();
console.log(quote)

/*
The variable joke will contain a random joke with a format:
{
   "body":"Artificial intelligence is no match for natural stupidity.",
   "tags":["intelligence","stupid"]
}
*/
var joke = jokesnquotes.getRandomJoke();
console.log(joke)

/*
One can add exclusion filter for the jokes tags
default is ['sex', 'racist']
*/
var joke = jokesnquotes.getRandomJoke({
   'exclude_tags': ['stupid', 'racist', 'love']
 });
console.log(joke)


/*
The variable joke 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 joke = jokesnquotes.getRandomJokeWithTag('stupid');
console.log(joke)

/*
One can add exclusion filter for the jokes tags
default is ['sex', 'racist']
*/
var joke = jokesnquotes.getRandomJokeWithTag('stupid', {
 'exclude_tags': ['attitude', 'sport', 'love']
});
console.log(joke)

Examples

examples

To view the examples, clone the jokesnquotes repo:

$ git clone https://github.com/ashwaniYDV/jokesnquotes.git
$ cd jokesnquotes

Then run the example/index.js:

$ node example

Let's get connected if we share the same views!

Invite me to connect on LinkedIn.

Facebook Instagram LinkedIn

One day your life will flash before your eyes. Make sure it is worth watching!

Stay Motivated Think Big Work Hard

Star History

Star History Chart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.