Skip to content

Maxime6678/rand-quote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published