Nothing Pleases Me

# npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

## beercalc_js

1.0.4 • Public • Published

# Beercalc Beercalc is a small helper class that holds various calculations to aid in designing your own beer recipes.

## Methods

### Beercalc.abv(og, fg)

Calculates an estimated alcohol by volume estimate based on the original gravity (og) of the wort and final gravity (fg) of the produced beer.

• og : number - original gravity
• fg : number - final gravity

### Beercalc.abw(og, fg)

Calculates an estimated alcohol by weight estimate based on the original gravity (og) of the wort and final gravity (fg) of the produced beer.

• og : number - original gravity
• fg : number - final gravity

### Beercalc.mcu(weight, lovibond, volume)

Calculates the Malt Color Unit of your recipe.

• weight : number - lbs of grain
• lovibond : number - lovibond value of the grain
• volume : number - gallons

### Beercalc.srm(weight, lovibond, volume)

Provides a more accurate color rating of your recipe using the Morey equation.

• weight : number - lbs of grain
• lovibond : number - lovibond value of the grain
• volume : number - gallons

### Beercalc.aau(alpha, weight)

Calculates the Alpha Acid Units in hops.

• weight : number - oz of hops
• alpha : number - Alpha percentage of the hops

### Beercalc.ibu(alpha, weight, time, gravity, volume)

Calculates the International Bittering Units scale. This is calculated per hop addition and needs. The sum of each hop addition is the total IBU for recipe.

• alpha : number - Alpha percentage of the hops
• weight : number - oz of hops
• time : number - minutes hops are in the boil
• gravity : number - gravity of the wort at the time of addition
• volume : number - volume of the recipe.

In the below example we have two hop additions. Each giving the IBU value for the respective addition. The total IBU for the recipe would be the summation of these two additions.

So the total IBU for the recipe is 25.365869680614512 + 6.03108750923272 = 31.39695718984723

### Beercalc.plato(sGravity)

Based on the specific gracity, determines the value in Plato.

• sGravity : number - specific gravity

### Beercalc.realExtract(og, fg)

Determines the real extract based on measured original and final gravity

• og : number - original gravity
• fg : number - final gravity

### Beercalc.calories(og, fg)

Determines the approximate calories that would be in a 12oz volume

• og : number - original gravity
• fg : number - final gravity

### Beercalc.attenuation(og, fg)

Calculates the percentage of attenuation from fermentation. Assuming og and fg are entered as 1.054 and not in Gravity Unit form.

• og : number - original gravity
• fg : number - final gravity

### Beercalc.gu(g)

Converts standard gravity measure (Ex. 1.054) to gravity units (Ex. 54) aka GU.

• g : number - gravity

### Beercalc.totalGravity(g, v)

The product of wort volume by the measured gravity.

• g : number - gravity
• v : number - volume in gallons

### Beercalc.finalGravity(g, vol_beg, vol_end)

The projected gravity of the final wort based on final volume. Returns in gravity units.

• g : number - gravity
• vol_beg : number - volume in gallons at the begining of the boil
• vol_end : number - volume in gallons at the end of the boil

### Beercalc.extractAddition(target_gu, total_gu, extractType)

In the even your mash does not produce a high enough gravity, you can add extract to reach your desired gravity. This method will let you add your target gravity, your total gravity from the mash and what kind of extract you would like to use. Return value will be the amount of extract in pounds that would need to be added in the boil.

• target_gu : number - Target Total Gravity in Gravity Units
• total_gu : number - Mash Total Gravity in Gravity Units
• extractType : string/number - should be 'LME' or 'DME' or custom value

### Beercalc.gravityCorrection(temp, g)

Corrects the gravity reading based on the temperature of the sample.

• temp : number - temperature in Fahrenheit
• g : number - gravity

## Keywords

none

### install

`npm i beercalc_js`

17

1.0.4

MIT

github.com

github