quote-lib
v2.0.1
Published
get motivational,funny and famous quotes
Downloads
381
Maintainers
Readme
Quote Lib
A simple library for generating quotes.
Installation
npm install quote-lib
Usage
Random Quote
import { getRandomQuote } from "quote-lib";
console.log(getRandomQuote());
Output
{
id: 5,
text: "If you can't explain it simply, you don't understand it well enough.",
author: 'Albert Einstein',
category: [ 'motivational', 'education' ]
}
Get Quote by ID
import { getQuoteById } from "quote-lib";
console.log(getQuoteById(5));
Output
{
id: 5,
text: "If you can't explain it simply, you don't understand it well enough.",
author: 'Albert Einstein',
category: [ 'motivational', 'education' ]
}
Get Quote by Category
import { getQuoteByCategory } from "quote-lib";
console.log(getQuoteByCategory("motivational"));
Output
{
id: 1,
text: "If you can't explain it simply, you don't understand it well enough.",
author: 'Albert Einstein',
category: [ 'motivational', 'education' ]
}
Get Quotes by Author
import { getQuotesByAuthor } from "quote-lib";
console.log(getQuotesByAuthor("Chris Grosser"));
Output
[
{
id: 3,
text: "Opportunities don't happen, you create them.",
author: 'Chris Grosser',
category: [ 'motivational', 'entrepreneur' ]
}
]
Get Quote by Author
import { getQuoteByAuthor } from "quote-lib";
console.log(getQuotesByAuthor("Chris Grosser"));
Output
{
id: 3,
text: "Opportunities don't happen, you create them.",
author: 'Chris Grosser',
category: [ 'motivational', 'entrepreneur' ]
}
License
MIT © Pasindu P Konghawaththa
Contributing
please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.