@divyanshu013/inspirational-quotes
v1.0.7
Published
Get inspired!
Downloads
41
Readme
Installation
yarn add @divyanshu013/inspirational-quotes
Usage
Check out all the existing quotes or the random quote demo.
Following exports are available from the module:
getAll()
- returns all quotesgetRandom()
- returns a random quote
The result is in the following shape:
{
"quote": "Always bet on JavaScript!",
"author": "Brendan Eich"
}
Some quotes also have a source
key. For example:
{
"quote": "Life moves pretty fast. If you don’t stop and look around once in a while, you could miss it.",
"author": "Ferris Bueller",
"source": "Ferris Bueller’s Day Off"
}
Example
// Use require or import, either works
const { getAll, getRandom } = require('@divyanshu013/inspirational-quotes');
console.log('All quotes', getAll());
console.log('A random quote', getRandom());