rand-quote

1.0.3 • Public • Published

rand-quote

npm version npm bundle size (minified)

Get a random quote provide by https://favqs.com

Install

$ npm install rand-quote

Usage

const randomQuote = require('rand-quote')

randomQuote().then((quote) => console.log(quote))
//=> "The great fun in my life has been getting up every morning and rushing to the typewriter because some new idea has hit me." -Ray Bradbury

Methods

randomQuote([config])
randomQuote().then((quote) => console.log(quote))
//=> "The great fun in my life has been getting up every morning and rushing to the typewriter because some new idea has hit me." -Ray Bradbury

randomQuote({
    quoteIt: true,
    body: true,
    author: false
}).then((quote) => console.log(quote))
//=> "The great fun in my life has been getting up every morning and rushing to the typewriter because some new idea has hit me."

Config

These are the available config options. No one is required. Everything is set to true by default.

{
    // Set to 'true', if you want to have '"quote"' or false will give you 'quote'
    quoteIt: true, // default

    // Set to 'true', if you want to have the body of the quote
    body: true, // default

    // Set to 'true', if you want to have the author name of the quote
    author: true // default
}

Test

$ git clone https://github.com/Maxime6678/rand-quote
$ npm install
$ node exemple/simple.js

License

MIT

Package Sidebar

Install

npm i rand-quote

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

4.37 kB

Total Files

6

Last publish

Collaborators

  • maxime6678