Skip to content

Instantly share code, notes, and snippets.

@danielgtaylor
Last active December 17, 2015 06:59
Show Gist options
  • Save danielgtaylor/5569645 to your computer and use it in GitHub Desktop.
Save danielgtaylor/5569645 to your computer and use it in GitHub Desktop.
Brauhaus.js examples
// Create a new recipe
var recipe = new Brauhaus.Recipe({
name: 'Daniel\'s Doppelbock',
description: '...',
author: 'Daniel G. Taylor'
batchSize: 20.0,
boilSize: 10.0
});
// Add some extra pale LME
recipe.add('fermentable', {
name: 'Extra pale liquid extract',
weight: 4.5,
color: 3.5,
yield: 75.0
});
// Late additions, which get added at the end of
// the boil are also supported
recipe.add('fermentable', {
name: 'Extra pale liquid extract',
weight: 2.0,
color: 3.5,
yield: 75.0,
late: true
})
// Add 1oz of Cascade hops
recipe.add('spice', {
name: 'Cascade',
weight: Brauhaus.lbOzToKg(0.0, 1.0),
time: 60,
aa: 5.6,
form: 'pellet'
});
// Add ground coriander at the end of the boil
recipe.add('spice', {
name: 'Coriander',
weight: 0.014,
time: 5,
form: 'ground'
});
// Add liquid yeast
recipe.add('yeast', {
name: 'Wyeast 3052',
type: 'ale',
form: 'liquid',
attenuation: 74.0
});
// Calculate various recipe values (OG, FG, IBU, ABV, etc)
recipe.calculate();
// Print out some values
console.log('OG: ' + recipe.og);
console.log('FG: ' + recipe.fg);
console.log('IBU: ' + recipe.ibu);
console.log('ABV: ' + recipe.abv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment