beerq
v2.0.1
Published
Library to generate beer quotes
Downloads
35
Maintainers
Readme
1. Installation
BeerQ is part of the ASALI project and it is a JavaScript library to get beer related quotes in different languages. You can check some of them here.
Its npm package can be installed as follow:
npm i beerq
The main advanntage of using BeerQ is that all quotes are hardcoded in JS variables, allowing the inclusion of BeerQ in any web application.
2. Examples
The use of BeerQ is pretty straightforward, but here you can find an example that might help:
import { BeerQuote } from "beerq"
// Generate beer quotes object with the language of your website
let beerQuote = BeerQuote("eng");
// Extract list of authors
let authorList = beerQuote.getAuthorList();
// Extract a random quote
let randomQuote = beerQuote.getRandomQuote();
// Extract quotes of a specific author
let authorQuotes = beerQuote.getQuotesFromAuthor("Benjamin Franklin");
// Extract a random quote of a specific author
let randomAuthorQuote = beerQuote.getRandomQuoteFromAuthor("W. C. Fields");
3. Contacts
If you want to contribute, ask questions, report bugs or just drink a beer with us feel free to open an issue.