random-quotes

1.3.0 • Public • Published

random-quotes

Get random quotes.

Installation

$ npm install --save random-quotes

Usage

NodeJS:

const randomQuotes = require('random-quotes');

Browsers:

<script src="node_modules/random-quotes/dist/index.umd.min.js"></script>
randomQuotes();
//  {
//    body: 'It\'s not poisonous...',
//    author: 'Famous Last Words'
//  }

API

  • randomQuotes([count=1])

    • count: Number, Optional: The number of random quotes to get.
    • Returns a random quote object with the following keys: author, body
    • When count is given, returns an array of random quotes.
  • randomQuotes.byAuthor(author)

    • author: String. The name of the author.
    • Returns an array of quotes by the given author. Array will contain the string bodies of the quotes directly.

License

MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    1,210
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.0
    1,210
  • 1.2.0
    1
  • 1.1.0
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i random-quotes

Weekly Downloads

784

Version

1.3.0

License

MIT

Last publish

Collaborators

  • arnellebalane