1.0.5 • Published 4 years ago

brewfacts v1.0.5

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

🍺 Brewfacts 🍺

What better way to learn about creating and publishing NPM packages than through the wonderful world of beer.

My first ever NPM package gives you access to fun facts about the world's historically most cherished beverage, available in a variety of categories. No longer will my incessant and boundless stream of beer facts be contained to just my own friends and family, but will now be unleashed into your application!

Usage

To utilize the included fact sets and methods, import them as shown below.

const { brewfacts } = require("brewfacts");

Current Categories

history - Learn about the wide and surprisingly old history of beer from every corner of the world.

brewing - Before you hit the local brewery for a tour, brush up on some facts about how beer is made.

styles - What even is an IPA??? Let brewfacts help you sort out what different kinds of beer bring to the table.

breweries - Don't know where to go next? Let brewfacts guide you to a new brewery.

Data access

Access the entire array of facts in any given category.

brewfacts.categories.CATEGORY.facts;

All facts combined into one array.

brewfacts.categories.all;

A list of breweries with their location and a reccommended brew.

brewfacts.breweries;

Methods

return a random fact from a category of your choice.

brewfacts.randomFactByCategory(categories.CATEGORY);

return a random fact from across all categories.

brewfacts.randomFactByAll();

return a random brewery reccommendation object.

brewfacts.reccommendRandomBrewery();

// Returns an object like this:
{
    name: "Sun King Brewery",
    city: "Indianapolis",
    state: "Indiana",
    whatToTry: "Velour Soccer Mom - Fruited Sour",
    oneLine: `${brewery.name} - ${brewery.city}, ${brewery.state}\nWhat to try: ${brewery.whatToTry}`;
}

return a brewery reccommendation object within a given state.

brewfacts.reccommendBreweryByState("TN");

Print a full pint to the console!

brewfacts.cheers();
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago