Last active
December 17, 2015 06:59
-
-
Save danielgtaylor/5569645 to your computer and use it in GitHub Desktop.
Brauhaus.js examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a new recipe | |
var recipe = new Brauhaus.Recipe({ | |
name: 'Daniel\'s Doppelbock', | |
description: '...', | |
author: 'Daniel G. Taylor' | |
batchSize: 20.0, | |
boilSize: 10.0 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add liquid yeast | |
recipe.add('yeast', { | |
name: 'Wyeast 3052', | |
type: 'ale', | |
form: 'liquid', | |
attenuation: 74.0 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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