quote-lib

1.0.2 • Public • Published

Quote-lib

get a random quote from specific category or from a famous person.

Installation

$ npm i quote-lib --save

Usage

$ const quotes=require('quote-lib');
get a random quote

$ const quote=quotes.getRandom();
$ console.log(quote);
//result
    {
        "category": [
            "motivational",
            "entrepreneur"
        ],
        "quote": "Successful entrepreneurs are givers and not takers of positive energy.",
        "author": "Anonymous"
    }
get a quote from specific category

$ const quote=quotes.getByCategory('programming');
$ console.log(quote);
//result
{
  category: [ 'programming' ],
  quote: 'The most disastrous thing that you can ever learn is your first programming language.',
  author: 'Alan Kay'
}
get a quote from famous a person

$ const quote=quotes.getByAuthor('Mahatma Gandhi');
$ console.log(quote);
//result
{
  category: [ 'education', 'motivational' ],
  quote: 'Live as if you were to die tomorrow. Learn as if you were to live forever.',
  author: 'Mahatma Gandhi'
}

Available Categories

motivational entrepreneur education programming

Pull requests are welcome.

Package Sidebar

Install

npm i quote-lib

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

7.64 kB

Total Files

5

Last publish

Collaborators

  • masterbr1an