1.3.0 • Published 8 years ago
random-quotes v1.3.0
random-quotes
Get random quotes.
Installation
$ npm install --save random-quotesUsage
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