{"_id":"brauhaus","_rev":"94-cd4a41f09c3555ec728c7bb27bf7b09d","name":"brauhaus","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","dist-tags":{"latest":"1.1.1"},"versions":{"0.0.4":{"name":"brauhaus","version":"0.0.4","description":"A beer recipe calculator","main":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":"","keywords":["beer","homebrew","homebrewing","malt","hops","yeast","ferment"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","uglify-js":"*"},"engines":{"node":">=0.6"},"readme":"BrauHaus.js\n===========\nA library for homebrew beer calculations using Node.js or a web browser. Features:\n\n * BeerXML import / export\n * Calculate OG, FG, IBU, ABV, and color\n * Automatically generated recipe instructions\n * Color to RGB conversions, CSS color support, etc\n\n[![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png?branch=master)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nInstallation\n------------\nYou can install BrauHaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (browser)\n-----------------------\nHere is an example of how to use the library in a browser. Be sure to copy the `lib/brauhaus.min.js` file onto the web server. This example assumes it is accessible via `/scripts/brauhaus.min.js`:\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    var r = new BrauHaus.Recipe({\n        name: 'My test brew',\n        description: 'A new test beer using BrauHaus.js!',\n        batchSize: 20.0,\n        boilSize: 10.0\n    });\n\n    r.add('fermentable', {\n        name: 'Extra pale liquid extract',\n        color: 2.5,\n        weight: 4.2,\n        yield: 78.0\n    });\n\n    r.calculate();\n\n    console.log('Original Gravity: ' + r.og.toFixed(3));\n    console.log 'Alcohol: ' + r.abv + ' by volume'));\n</script>\n```\n\nQuick Example (Node.js CoffeeScript)\n------------------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n{Recipe} = require 'brauhaus'\n\nr = new Recipe\n    name: 'My test brew'\n    description: 'A new test beer using BrauHaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.calculate()\n\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Alcohol: #{ r.abv }% by volume\"\n```\n\nQuick Example (Node.js Javascript)\n----------------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\nRecipe = require('brauhaus').Recipe\n\nvar r = new Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using BrauHaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.calculate();\n\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log 'Alcohol: ' + r.abv + ' by volume'));\n```\n\nReference\n---------\nComing soon...\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.0.4","dist":{"shasum":"3ad3728ab2941e1231d60e1ee47c462f74d91785","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.0.4.tgz","integrity":"sha512-aIfTdVjYj1IDvrzwkN8y13V2PmkDj04QJI4uSqMcbGUmxEGdc6mpMxt5i/JNbnx1WzdCb9WuIS/zjNfGmm9qdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIX4EX7fvLOZfxf/pWAuxtvqPrqcoVCWhO0RLgS0fjRAIhAL8IaywSN8mjqgz/Np680JYeU5+okisRFRE+bTejebsU"}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.0.6":{"name":"brauhaus","version":"0.0.6","description":"A beer recipe calculator","main":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":"","keywords":["beer","homebrew","homebrewing","malt","hops","yeast","ferment"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js\n===========\nA library for homebrew beer calculations using Node.js or a web browser. Features:\n\n * BeerXML import / export\n * Calculate OG, FG, IBU, ABV, and color\n * Automatically generated recipe instructions\n * Color to RGB conversions, CSS color support, etc\n\n[![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png?branch=master)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nInstallation\n------------\nYou can install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (browser)\n-----------------------\nHere is an example of how to use the library in a browser. Be sure to copy the `lib/Brauhaus.min.js` file onto the web server. This example assumes it is accessible via `/scripts/Brauhaus.min.js`:\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    var r = new Brauhaus.Recipe({\n        name: 'My test brew',\n        description: 'A new test beer using Brauhaus.js!',\n        batchSize: 20.0,\n        boilSize: 10.0\n    });\n\n    r.add('fermentable', {\n        name: 'Extra pale liquid extract',\n        color: 2.5,\n        weight: 4.2,\n        yield: 78.0\n    });\n\n    r.calculate();\n\n    console.log('Original Gravity: ' + r.og.toFixed(3));\n    console.log 'Alcohol: ' + r.abv + ' by volume'));\n</script>\n```\n\nQuick Example (Node.js CoffeeScript)\n------------------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n{Recipe} = require 'brauhaus'\n\nr = new Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.calculate()\n\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Alcohol: #{ r.abv }% by volume\"\n```\n\nQuick Example (Node.js Javascript)\n----------------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\nRecipe = require('brauhaus').Recipe\n\nvar r = new Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.calculate();\n\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log 'Alcohol: ' + r.abv + ' by volume'));\n```\n\nReference\n---------\nComing soon...\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.0.6","dist":{"shasum":"9c90ae4413f33f885169870877d1171eb19bebd1","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.0.6.tgz","integrity":"sha512-0wHqwQZgic/biQ0+K50Fm9ZJbbwLQBw9BUxv7c7IOVoM8Ak+9a3Vkb3YYvZV2eEmcVq/NgJN7JeEg9BLo2znTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjHwNgD0whJdJcvsb1/E+uNCCaegatvC9YMnDyk94T7AIhAIUHhhxCGdYU9KF3kPMOh8BPGTTbDPDvhr+DO99Qi+7k"}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.0.7":{"name":"brauhaus","version":"0.0.7","description":"A beer recipe calculator","main":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":"","keywords":["beer","homebrew","homebrewing","malt","hops","yeast","ferment"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js\n===========\nA library for homebrew beer calculations using Node.js or a web browser. Features:\n\n * BeerXML import / export\n * Calculate OG, FG, IBU, ABV, and color\n * Automatically generated recipe instructions\n * Estimate recipe cost based on ingredients\n * Color to RGB conversions, CSS color support, etc\n\n[![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nInstallation\n------------\nYou can install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (browser)\n-----------------------\nHere is an example of how to use the library in a browser. Be sure to copy the `lib/Brauhaus.min.js` file onto the web server. This example assumes it is accessible via `/scripts/Brauhaus.min.js`:\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    var r = new Brauhaus.Recipe({\n        name: 'My test brew',\n        description: 'A new test beer using Brauhaus.js!',\n        batchSize: 20.0,\n        boilSize: 10.0\n    });\n\n    r.add('fermentable', {\n        name: 'Extra pale liquid extract',\n        color: 2.5,\n        weight: 4.2,\n        yield: 78.0\n    });\n\n    r.calculate();\n\n    console.log('Original Gravity: ' + r.og.toFixed(3));\n    console.log('Alcohol: ' + r.abv + ' by volume');\n</script>\n```\n\nQuick Example (Node.js CoffeeScript)\n------------------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n{Recipe} = require 'brauhaus'\n\nr = new Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.calculate()\n\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Alcohol: #{ r.abv }% by volume\"\n```\n\nQuick Example (Node.js Javascript)\n----------------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\nRecipe = require('brauhaus').Recipe\n\nvar r = new Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.calculate();\n\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Alcohol: ' + r.abv + ' by volume');\n```\n\nReference\n---------\nComing soon...\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.0.7","dist":{"shasum":"53db5bf2f1ead0e78a19b3d1786d824d82619895","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.0.7.tgz","integrity":"sha512-j4DmL3eTqXQXGokbOkkSOXkGV1f4vnMMI91LZztIcXJNm0afDY7wcvlbketHI3uVHa+H2Oe0393zA/a9AdOrDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7DhZdDKcZOI1tFDsWqHDbaS87p5m3tR9iVNRH5VUaZAIgZcVihIiINK05uQ/Zr8bujf1alB7zP5XuEtUxCAmIo9g="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.0.8":{"name":"brauhaus","version":"0.0.8","description":"A beer recipe calculator","main":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":"","keywords":["beer","homebrew","homebrewing","malt","hops","yeast","ferment"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA library for homebrew beer calculations. Features:\n\n * Supports web browsers and Node.js\n * BeerXML import / export\n * Calculate OG, FG, IBU, ABV, and color\n * Tinseth and Rager IBU formula support\n * Automatically generated recipe instructions\n * Estimate recipe cost based on ingredients\n * Color to RGB conversions, CSS color support, etc\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on Node.js (server-side). To use Brauhaus.js in a web browser, simply download the following file and jump to the quick example for your browser below:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/lib/brauhaus.min.js)\n\nFor Node.js, you can install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (browser)\n-----------------------\nHere is an example of how to use the library in a browser. Be sure to copy the `lib/brauhaus.min.js` file onto the web server. This example assumes it is accessible via `/scripts/brauhaus.min.js`:\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    var r = new Brauhaus.Recipe({\n        name: 'My test brew',\n        description: 'A new test beer using Brauhaus.js!',\n        batchSize: 20.0,\n        boilSize: 10.0\n    });\n\n    r.add('fermentable', {\n        name: 'Extra pale liquid extract',\n        color: 2.5,\n        weight: 4.2,\n        yield: 78.0\n    });\n\n    r.add('spice', {\n        name: 'Cascade hops',\n        weight: 0.028,\n        aa: 5.0,\n        use: 'boil',\n        form: 'pellet'\n    });\n\n    r.calculate();\n\n    console.log('Original Gravity: ' + r.og.toFixed(3));\n    console.log('Alcohol: ' + r.abv + ' by volume');\n    console.log('IBU: ' + r.ibu.toFixed(1));\n</script>\n```\n\nQuick Example (Node.js CoffeeScript)\n------------------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n{Recipe} = require 'brauhaus'\n\nr = new Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.calculate()\n\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Alcohol: #{ r.abv }% by volume\"\nconsole.log \"IBU: ' + r.ibu.toFixed(1));\n```\n\nQuick Example (Node.js Javascript)\n----------------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\nRecipe = require('brauhaus').Recipe\n\nvar r = new Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.calculate();\n\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Alcohol: ' + r.abv + ' by volume');\n```\n\nReference\n---------\nComing soon...\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.0.8","dist":{"shasum":"206bfcb23a69d83f5b707e9e122b961cde2157d9","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.0.8.tgz","integrity":"sha512-AvAhRFeIXpX8s9clZtsUyVAssF0OJghqmoQAVB67IvUH1+zS/b5Lq5O4htEP6Jkv6UJ8CZrXo2Ykd1F+1tlxQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATqZV2WRzWxuHkfa+VrJ7WgxRvPpt8lNOYOK3jO/XUiAiBvajb0P7311CP3UMjcbR+fn4uwtt0DiZLsuJLh8LlKHw=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.0.9":{"name":"brauhaus","version":"0.0.9","description":"A beer recipe calculator","main":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":"","keywords":["beer","homebrew","homebrewing","malt","hops","yeast","ferment"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA library for homebrew beer calculations. Features:\n\n * Supports web browsers and Node.js\n * BeerXML import / export\n * Calculate OG, FG, IBU, ABV, and color\n * Tinseth and Rager IBU formula support\n * Automatically generated recipe instructions\n * Estimate recipe cost based on ingredients\n * Color to RGB conversions, CSS color support, etc\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on Node.js (server-side). To use Brauhaus.js in a web browser, simply download the following file and jump to the quick example for your browser below:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/lib/brauhaus.min.js)\n\nFor Node.js, you can install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (browser)\n-----------------------\nHere is an example of how to use the library in a browser. Be sure to copy the `lib/brauhaus.min.js` file onto the web server. This example assumes it is accessible via `/scripts/brauhaus.min.js`:\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    var r = new Brauhaus.Recipe({\n        name: 'My test brew',\n        description: 'A new test beer using Brauhaus.js!',\n        batchSize: 20.0,\n        boilSize: 10.0\n    });\n\n    r.add('fermentable', {\n        name: 'Extra pale liquid extract',\n        color: 2.5,\n        weight: 4.2,\n        yield: 78.0\n    });\n\n    r.add('spice', {\n        name: 'Cascade hops',\n        weight: 0.028,\n        aa: 5.0,\n        use: 'boil',\n        form: 'pellet'\n    });\n\n    r.calculate();\n\n    console.log('Original Gravity: ' + r.og.toFixed(3));\n    console.log('Alcohol: ' + r.abv + ' by volume');\n    console.log('IBU: ' + r.ibu.toFixed(1));\n</script>\n```\n\nQuick Example (Node.js CoffeeScript)\n------------------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n{Recipe} = require 'brauhaus'\n\nr = new Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.calculate()\n\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Alcohol: #{ r.abv }% by volume\"\nconsole.log \"IBU: ' + r.ibu.toFixed(1));\n```\n\nQuick Example (Node.js Javascript)\n----------------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\nRecipe = require('brauhaus').Recipe\n\nvar r = new Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.calculate();\n\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Alcohol: ' + r.abv + ' by volume');\n```\n\nReference\n---------\nComing soon...\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.0.9","dist":{"shasum":"100772280f621846a0c4509b25ff49a9f2267602","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.0.9.tgz","integrity":"sha512-cpgZdnZyQSLCxJa9ibfo7BdR8WTCoOdlbGFFGxX7Z9b6qY4KRFgy4H/djjXF3GSvcw/LHzVuWscfEFvXlezCFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHuQRJwhzhVLuNCEQo/mXWDqKkbpztz8xLSkanp5JfTcAiEAj8K18QsZYXaHFoqJ95ktQc0x02iz9QmpNA8NRw9teuI="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.1":{"name":"brauhaus","version":"0.1.1","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA library for homebrew beer calculations both in the browser and on the server. Features:\n\n * Supports multiple Javascript runtimes (web browsers, Node.js, etc)\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost based on ingredients\n * Built-in unit conversions (kg -> lb/oz, liter -> gallon, temps, etc)\n * Color to RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](https://github.com/danielgtaylor/malt.io), a community website for homebrewers.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM }\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nBrauhaus = require('brauhaus')\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[ 208, 88, 13 ]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n\n### Fermentable.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\n### Fermentable.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\nBrauhaus.Spice\n--------------\nComing soon!\n\nBrauhaus.Yeast\n--------------\nComing soon!\n\nBrauhaus.Recipe\n---------------\nComing soon!\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.1","dist":{"shasum":"6deb80f2e3b463449ff482db190b858ce539f729","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.1.tgz","integrity":"sha512-UMmcbPAIqSwQSaE6pKRMXg2R3dmty+9+mY+j9znIeqj1SwIFxmEgRIpYoX5KYPU/NJmMpZPnV2Pg0dYJr6GMOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHrvQGRWW7GRghKxz/yn6r439eDj+qXGe5jTFCHz805qAiEAyUJe1oByNm6onqABV5KL8+Wzmg6MKeQcraek2nN0WiQ="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.2":{"name":"brauhaus","version":"0.1.2","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA library for homebrew beer calculations both in the browser and on the server. Features:\n\n * Supports multiple Javascript runtimes (web browsers, Node.js, etc)\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color to RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create and share recipes.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nComing soon!\n\nBrauhaus.Recipe\n---------------\nComing soon!\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.2","dist":{"shasum":"d332d355df96a7a32802190251a3fd166f41151c","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.2.tgz","integrity":"sha512-VE6FWY9lp37p5boq11FdZ0mibNNCD9m0w1Zr33nr2NcT9jmj2Kwvs71bsk6NU0Qm80O04j4ACFccMmpcC9riJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAzMdAC+cXyrPfSm/5fJqPJa0cG0sndBpdEecZnbJnNKAiAPQ6yFhuKME8wrMawDBzsxQKVByB/H7kbQWh5BsgjF6g=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.3":{"name":"brauhaus","version":"0.1.3","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*","xmldom":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA library for homebrew beer calculations both in the browser and on the server. Features:\n\n * Supports multiple Javascript runtimes (web browsers, Node.js, etc)\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color to RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create and share recipes.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Spice.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nComing soon!\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.3","dist":{"shasum":"ab632c4f8a2aaa657b18083d0b94dbf5f6c77856","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.3.tgz","integrity":"sha512-iaNtNilaFBjeTzCLJJkZ/TK2qo4jmTEWTI02R15AylqdCnihzJ8wpq5019Vd5HtHmsXwvP7tmpDoytWBIRaFBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH88c3o+n80JEGpsJ2v841bvourlntpa5UzPvgNjeSXAAiBDaVnTbFmIfe9gf1AVapkxoTAU5JgSCvamG7hQVQh5kw=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.5":{"name":"brauhaus","version":"0.1.5","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor"},"license":"MIT","devDependencies":{"coffee-script":"*","mocha":"*","mocha-phantomjs":"*","chai":"*","uglify-js":"*","xmldom":"*"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA library for homebrew beer calculations both in the browser and on the server. Features:\n\n * Supports multiple Javascript runtimes (web browsers, Node.js, etc)\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color to RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create and share recipes.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112]\n    fg: [1.016, 1.024]\n    srm: [6, 25]\n    ibu: [16, 26]\n    abv: [7, 10]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.5","dist":{"shasum":"04164651c881aaa02fb05083a2b092733e8a8de3","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.5.tgz","integrity":"sha512-Uo5uPMRAG/P4nox2/2wNtEsk92ppvWUl1dzL14IGfD2xEoTFuL1ISIg6N770vVL9EiBqFCtCJL7RK2w3qKvR8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE7fC49yHoBLQALy/Af3FC/AntmysKIV2Bqt4FonQXXzAiAesdhVawi4wStsfI105A9jCMICWgp0ABNU2U6Qrr9afw=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.6":{"name":"brauhaus","version":"0.1.6","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.4.x","mocha":"1.8.x","mocha-phantomjs":"2.0.x","chai":"1.5.x","uglify-js":"2.2.x"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.9.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112]\n    fg: [1.016, 1.024]\n    srm: [6, 25]\n    ibu: [16, 26]\n    abv: [7, 10]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.6","dist":{"shasum":"99cb7abff28f3c3e63752f3f36b613b880aae57e","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.6.tgz","integrity":"sha512-SLT9E8lAJWly/zSZsdOivSJiKB/rKOcnb4t2/m7m4HTvfeWC+QyttYvSzQ6DO5v2eABOwFmKl4WM1MANYUYfGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICl7kLPAW6Kp8q5VgIBoZ232m5JyuztdvSZ7sdf8+gEZAiEAua/HHnGIYfFDogALfixERO3BY6yYQIuRqdvTQ464ptI="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.7":{"name":"brauhaus","version":"0.1.7","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.4.x","mocha":"1.8.x","mocha-phantomjs":"2.0.x","chai":"1.5.x","uglify-js":"2.2.x"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.9.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112]\n    fg: [1.016, 1.024]\n    srm: [6, 25]\n    ibu: [16, 26]\n    abv: [7, 10]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.7","dist":{"shasum":"667fd48b86df7a91f26859e0f026ee389a70eabb","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.7.tgz","integrity":"sha512-Ipikk7z85q1Z40qInorL+jVvLWs5Oj/0Bf8DtI4/eGQtx9w8yNRMXx8GMMFKVkJY0Vv8Nqbh0o3BDyWMUhtOdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC1bFSD2QmQHzrgBo3POPSOoarRZicTnKCofk3ciuB/4AiA8vk8ufzFejzd7Jwwhnj0gPVZXFEosoEX4MXMf9uDVHA=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.8":{"name":"brauhaus","version":"0.1.8","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.4.x","mocha":"1.8.x","mocha-phantomjs":"2.0.x","chai":"1.5.x","uglify-js":"2.2.x"},"engines":{"node":">=0.6"},"readme":"Brauhaus.js [![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n===========\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.9.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112]\n    fg: [1.016, 1.024]\n    srm: [6, 25]\n    ibu: [16, 26]\n    abv: [7, 10]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.8","dist":{"shasum":"21d2f152d8a19b3fa600fbd4ff50f3e2b1c22933","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.8.tgz","integrity":"sha512-2+++1+zElzTb6QDA/K/0IEaXD26J94Gb0gB5cXEqQNa/XDisDG1+SXb2InwTd2qS67vgvz9CXlt0Z9mouAki0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZ1mAIeZ0b/22SQ7PgmdO1zLcYIMl3svR32ndbeV5dDAiEA5nTcF3KJ/eeaOeH2gfu9W22AhFdNhABiTT1Praoi3ic="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}],"directories":{}},"0.1.9":{"name":"brauhaus","version":"0.1.9","description":"A library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","bacteria","ferment","fermenting","fermentation","calculate","calculator","calculation","recipe"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.9.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112]\n    fg: [1.016, 1.024]\n    srm: [6, 25]\n    ibu: [16, 26]\n    abv: [7, 10]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.1.9","dist":{"shasum":"8d457f2ac3acef521ef249ae5f0fe19c127ca10a","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.1.9.tgz","integrity":"sha512-ElncNFqkCOuOnLkcMwpMf+gpDc9sEs7BM3xPReKrdznA6I5tINhikQmEFaHTpsZe2Nlzl1qfXA/cP5PfO4MBtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2ZGSRa3XKSdRaNYLRXGaMoLOqa/e/QOjGvkXXGvXvZAIgBucsLPj4gW/ekF2Y9RDnsGknjVsOSPKT6hDoEndONVc="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.2.0":{"name":"brauhaus","version":"0.2.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.9.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112]\n    fg: [1.016, 1.024]\n    srm: [6, 25]\n    ibu: [16, 26]\n    abv: [7, 10]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.2.0","dist":{"shasum":"9e9c3e3ca49d7c603d957fcd7bf7057e167ad5db","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.2.0.tgz","integrity":"sha512-wGb6EK6itbQPB2rMnJmocqkfbW+CKzE1Cv+HxIF/4tHXe8KZjATSQy2PgoGVw2MnbDDSnOV4BxE1rCRlw0j97A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHP/CIIuGTvYyUzpyBE2rk36RYazxP9PVKmgIhzMisMpAiAwAYOMlw0p7FzmeNv0C0TCd+6ZbyPo06r+io+kWzlI8A=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.2.1":{"name":"brauhaus","version":"0.2.1","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.9.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112]\n    fg: [1.016, 1.024]\n    srm: [6, 25]\n    ibu: [16, 26]\n    abv: [7, 10]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.2.1","dist":{"shasum":"bb487d1da92f5aa2132b3a3b133e1246b799b83e","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.2.1.tgz","integrity":"sha512-gjSBOJSuZL9iBMW2QT13yBe6LdQbWS0L+UtocTa8eA+/glareRVlrvhcj2oM9raHBAIA7FOUx1FBNrmgX81D/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcGOmG/FiMoXT1i1+gsgPK7Jm58yDxGe/rJ1toJfYqvAIgCfGR8bmQFGaJhY80cZuwSNmZkuAfvXVECCQLNF5IMZM="}]},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.2.2":{"name":"brauhaus","version":"0.2.2","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet the various ranges for a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.2.2","dist":{"shasum":"dfde7b20a8d3e932313a8a3dd8f61c8243e55326","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.2.2.tgz","integrity":"sha512-Jk5Y4vLc30LUUDScWGl7L+JKmR/Y3WXWUfTNS3viNgkgh1B+f8DTDDICdp46L/E/zgvTRMrCDj0WTlLCeSUybA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICgdqP6Pkt+yErLl5YG/fkXKa0rQ5NIIMZS8trG8otDWAiB/4RjKHMYpP5+y9+LHox3sglg7S43YWexSgURP/GfEpQ=="}]},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.2.3":{"name":"brauhaus","version":"0.2.3","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"cake build","prepublish":"cake build","test":"cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.2.3","dist":{"shasum":"4fd6d3331b4ebe8465f4a8b5fba991c1b539655b","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.2.3.tgz","integrity":"sha512-BCWg0+wbbxeE5jOuzqdNS7QVH140Z1ThWUGag9MNkQbp6J3LmPIbZJhJjtPfIZ2NTHaNst6omDsHqChjLFx4wA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCWUzOXzoquUAgr5K0qC+ZAuycrPiiED4teVH5NqbfcgIhAO49EeXT/yN/pL5KvovohB7QIu4O0qB5DlKZL2OlTnvr"}]},"_from":".","_npmVersion":"1.2.17","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.2.4":{"name":"brauhaus","version":"0.2.4","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.9 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.2.4","dist":{"shasum":"1de8ed0a441f8fe652cb63cefd2db05b406df8d5","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.2.4.tgz","integrity":"sha512-DKhLHeAE7PUdWEVE9nkF9+NSjFpedjoz2Am06c7J7CCwlQjxRpVMNYs6iaqUXgRdX79TOiU1yK+PF/Cz4dNmVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFM2Ys8gZWC8HTFO1jdrJv23cfHBuoF3O64k4YtnJbeKAiATvsb2/JppKjcMUF6btnP4nqp5RN1wc1r8fn5y1EDaCA=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.3.0":{"name":"brauhaus","version":"0.3.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.3.0","dist":{"shasum":"de5247cda1972d7a11d03b577b27f57c3c23086b","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.3.0.tgz","integrity":"sha512-aOntYeIcNMoEs8YnwkgpXdyuo1wm9a3o1Is8ShKVS+AaEUbTYoFGDGXt1gWVo2KR5yFNWc245f+sMS7uzWRjZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvdtemugGeAPRajHoot9v8LlGHwaa2KZsVd2puyAXweAiEAluLLgSseqAhCYzuezoSM8zE+VeNx25Xo19dyy9qV0x0="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.3.1":{"name":"brauhaus","version":"0.3.1","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.3.1","dist":{"shasum":"5c4efdd7a768371469b6912b9491fbddb95a7fee","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.3.1.tgz","integrity":"sha512-DazsBfpRjxLRg9TRqq3PPuHv7u29eSuzMmFk+y1ve83wDWY7IOmGlTTVaCPDM2SN7ACEjqj1nTDPgQo1QU8PUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmFcIUQpAcx7qR5/Mo52iJnbbC5u0QKvZgt1Z3pJ00+QIgbyPA/5GDLZwLd5jQ7b7s5oSjwGIxn8ix07nLibm0hL0="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.3.2":{"name":"brauhaus","version":"0.3.2","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs) [![Coverage Status](https://coveralls.io/repos/danielgtaylor/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/danielgtaylor/brauhausjs?branch=master)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, RGB conversions, CSS color support, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.3.2","dist":{"shasum":"7ec7fbc05811d6022caa3f758e3788bb6ecd38d1","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.3.2.tgz","integrity":"sha512-39tvt2KQgY0KoyOHzO0dvNNnTaVnwGjqVBeQkrxmpek6Tf8EuYHY6Aps5SIcMtTF4uX8XaXfH9b30mhCsYN3PA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAYj4X0cgJS75Jwdmbm7AgK/KF0Ed5Iurkb3K0GyEn5QAiBMENeTz4sZYJlC7lh7zeWShpUWU53tdL+wBBTGuJi1lQ=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.4.0":{"name":"brauhaus","version":"0.4.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs) [![Coverage Status](https://coveralls.io/repos/danielgtaylor/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/danielgtaylor/brauhausjs?branch=master)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.4.0","dist":{"shasum":"1fc04d9257b97f19efc7b21249638f3966665860","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.4.0.tgz","integrity":"sha512-J0C7DZMOoSKFu+z7UOjyww1oeYnPUf8hQZWKYd7Y+GGsdZ9CcDPmmoRnPh86JNY3EGy999V8JwcagNH4bVQFcA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFpv332HrG0D69EIWWfEfRTBIWFGU0NfFccg573LjcORAiBTs2zbpabSB9ImUCr9+uouveYuMYcTz34H3cTEwJl1yQ=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.5.0":{"name":"brauhaus","version":"0.5.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs) [![Coverage Status](https://coveralls.io/repos/danielgtaylor/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/danielgtaylor/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes.'],\n    [40, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.5.0","dist":{"shasum":"ee5898fe19d66212ea67c9ef274d59df1994a2f2","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.5.0.tgz","integrity":"sha512-iZfMNzgQ1CQk465TKcVAZdMpQsA0WHmZqSCX88yqSpprMmJu4qiwEsgv1o1Tpb9nZXP/3W3nmMgNJoPYhFfH7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrarDXQnyTDb6SyBCEQVY8aRc4UfvxsaMyWE0uhTgjhgIhAN+B0j0WbJByMESSkbUXchsQdBUX9Fz8XbMeZDUdcsvs"}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.5.1":{"name":"brauhaus","version":"0.5.1","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs) [![Coverage Status](https://coveralls.io/repos/danielgtaylor/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/danielgtaylor/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'spice',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('spice', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt'\n    weight: 4.0\n    yield: 75\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.5.1","dist":{"shasum":"8bf6ca9777f7059692f9ff6f317ab201211e88ce","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.5.1.tgz","integrity":"sha512-8/bfcNktZqrYMLyknuAyNYZk/BUNznQOUwBJbn21LS+OocoqSFYohVNJu8uDt/mbwz7FvKOpD/7ky6GTF5n9Kg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEhJ1od+lPNEkI48Kb+72eKwRsfdevt+8K4eLrLaboHqAiEAtnuEQ+lQ9QNMTynBIIObRksnp4SRqWyr8GL1NfZLS58="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.5.2":{"name":"brauhaus","version":"0.5.2","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":"1.x","mocha":"1.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs) [![Coverage Status](https://coveralls.io/repos/danielgtaylor/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/danielgtaylor/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.5.2","dist":{"shasum":"52a65988ed74decc6f7d92d72111c41238d7f277","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.5.2.tgz","integrity":"sha512-fnbNwyzjSywSI1WZvlZJzLg6gIMAjuyB3SQ5gfSqLQJYgpMxfDS3k+XKI7GxIDgjVjRhMEF1F0SejCpZrmofjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGck/iYTWW8YiP4m+lrFBiJ3A2DrB6HAr3t7RSwwwvUmAiB95mMkSSzkUPI5Uhyv5XyhXDIsBQ7AcCcVvt34B5kjmg=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.5.3":{"name":"brauhaus","version":"0.5.3","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":">=1.6.2 <2","mocha":"1.9.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs) [![Coverage Status](https://coveralls.io/repos/danielgtaylor/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/danielgtaylor/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.5.3","dist":{"shasum":"2587799fa72d95513bd7351c285f865273606bca","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.5.3.tgz","integrity":"sha512-8gYM+MGMtrpg3N8uAzWs5c2nxr1AcORh66bAak3+mKQi9JgAGCKJu0+g02LQ8sQaqjLhyTGIlQ2a0mD1/B7L9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHk24zOLlIYK7qolujzw8aUUnGDwkyV7WvSFQvvcLsJAiEAy9lNQF247zK7W39CFhT7A6z2R3gr7ogzcO9RiDGuK68="}]},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.5.4":{"name":"brauhaus","version":"0.5.4","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/danielgtaylor/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/danielgtaylor/brauhausjs"},"bugs":{"url":"https://github.com/danielgtaylor/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"http://programmer-art.org/"},"license":"MIT","dependencies":{"xmldom":"0.1.x"},"devDependencies":{"coffee-script":">=1.6.2 <2","coffeelint":">=0.5.6 <1","mocha":"1.9.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/danielgtaylor/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/danielgtaylor/brauhausjs.png)](https://gemnasium.com/danielgtaylor/brauhausjs) [![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png)](https://travis-ci.org/danielgtaylor/brauhausjs) [![Coverage Status](https://coveralls.io/repos/danielgtaylor/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/danielgtaylor/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * BeerXML import / export\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/danielgtaylor/brauhausjs/master/dist/brauhaus.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = Brauhaus ? require 'brauhaus'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = Brauhaus || require('brauhaus');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.fromBeerXml (xml)\nGet a list of recipes from BeerXML loaded as a string.\n\n```javascript\n>>> xml = '<recipes><recipe><name>Test Recipe</name>...</recipe></recipes>'\n>>> recipe = Brauhaus.Recipe.fromBeerXml(xml)[0]\n<Brauhaus.Recipe object 'Test Recipe'>\n```\n\n---\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\n### Recipe.prototype.toBeerXml ()\nConvert this recipe into BeerXML for export. Returns a BeerXML string.\n\n```javascript\n>>> r.toBeerXml()\n'<?xml version=\"1.0\"><recipes><recipe>...</recipe></recipes>'\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.5.4","dist":{"shasum":"b32400d27e04acc8da2caa223372c5466b76c4ff","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.5.4.tgz","integrity":"sha512-srDbOTJQbHSVknIWiFTB8/V48NdzO+kZmG8dT3hbAR4jym1csWEP2SBMmssyzZnsO6QziK7lB/dJY3mZNxPqJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDu7W6HQAG5enmUTpmZSPmdttD2pPEGuycQq2+ik21NjQIhANw4RHNT5ZmrGXIdHvJOuc7i2udc6NkFQVzM+zNmGGKL"}]},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.6.0":{"name":"brauhaus","version":"0.6.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.2 <2","coffeelint":">=0.5.6 <1","mocha":"1.9.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBeer Styles\n-----------\nBrauhaus ships with many pre-defined beer styles from BJCP.\n\n### Brauhaus.getStyleCategories ()\nGet a list of BJCP style categories supported by Brauhaus.\n\n```javascript\n>>> Brauhaus.getStyleCategories()\n['Light Lager', 'Pilsner', 'Bock', ...]\n```\n\n### Brauhaus.getStyles (string)\nGet a list of styles for a particular category\n\n```javascript\n>>> Brauhaus.getStyles('Bock')\n['Maibock / Helles Bock', 'DoppelBock', ...]\n```\n\n### Brauhaus.getStyle (category, style)\nGet an object representing a particular style.\n\n```javascript\n>>> Brauhaus.getStyle('Bock', 'Doppelbock')\n{\n    name: 'Doppelbock',\n    category: 'Bock',\n    gu: [1.072, 1.112],\n    fg: [1.016, 1.024],\n    srm: [6, 25],\n    ibu: [16, 26],\n    abv: [7, 10],\n    carb: [1.6, 2.4]\n}\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.6.0","dist":{"shasum":"aa3cd880e6bc514ade34ff8e7d279a721a849811","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.6.0.tgz","integrity":"sha512-YInMsghLmcAFOBzXgBa4qwKhdD0vkj3TBQ//7B7WBacizFcznc51zAeyLHESM496PdaZ9l3lGW1Os1yyVkTsHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHZ6HOSn4jGIdQTmZoKBkCrMYzSoF3KH2DR4gloZpJ9AIgDvhEMBEO15zhLjk9MSi6rAwBS26r7ph7zTClUgKasG4="}]},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.7.0":{"name":"brauhaus","version":"0.7.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.2 <2","coffeelint":">=0.5.6 <1","mocha":"1.9.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 24kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.7.0","dist":{"shasum":"b8b322fdc40be82df7f413c845c682ee3c7ff7ea","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.7.0.tgz","integrity":"sha512-3tYEuHJ4pmyf/8ohXUivlTEmpQ+xoWHAnU6EmY4McNjaHLqgk1qC12W7ix4NydQibtW/dW7AWfCllNMOWDl1ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID5oQpj4wBK34pWnGY4+qm6HsHq0pUGYOXkzvgtTRVJtAiEA2Jv+YkM6yAUFC/3XpN7hYCJjkQQWqR6puyjERaSWqI0="}]},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.8.0":{"name":"brauhaus","version":"0.8.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.2 <2","coffeelint":">=0.5.6 <1","mocha":"1.9.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 28kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nSerialization\n-------------\nA Brauhaus object can be easily serialized and deserialized from a JSON format. Deserialization can be from a JSON string or an object (i.e. the value given by `JSON.parse(...)`). For example, to serialize and deserialize a recipe object:\n\n```javascript\nvar r, serialized;\n\n// Serialize\nr = new Brauhaus.Recipe(...);\nserialized = JSON.stringify(r);\n\n// Deserialize from JSON string\nserialized = '...';\nr = new Brauhaus.Recipe(serialized);\n\n// Deserialize from parsed object\nserialized = JSON.parse('...');\nr = new Brauhaus.Recipe(serialized);\n```\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.8.0","dist":{"shasum":"14c51e54e4b9df363b025ed770254844bc922124","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.8.0.tgz","integrity":"sha512-mSLLgCE8HZ31rLHUedfjcYp816xMK4aQIv8eJepfhaA/F/+vsznbXVamRXhp8nKjeE5xw9Uyv3jtvTMxgY/ywA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbi4u1HslCHwMBCknUNvtedFnMad3GEdDNuhyDpmfHfAIhAPLmEvcSFOBfAB9Hhz0Qtg8mDPkdqzJifcPdpLApb1gR"}]},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.8.1":{"name":"brauhaus","version":"0.8.1","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.2 <2","coffeelint":">=0.5.6 <1","mocha":"1.9.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 28kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nSerialization\n-------------\nA Brauhaus object can be easily serialized and deserialized from a JSON format. Deserialization can be from a JSON string or an object (i.e. the value given by `JSON.parse(...)`). For example, to serialize and deserialize a recipe object:\n\n```javascript\nvar r, serialized;\n\n// Serialize\nr = new Brauhaus.Recipe(...);\nserialized = JSON.stringify(r);\n\n// Deserialize from JSON string\nserialized = '...';\nr = new Brauhaus.Recipe(serialized);\n\n// Deserialize from parsed object\nserialized = JSON.parse('...');\nr = new Brauhaus.Recipe(serialized);\n```\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.8.1","dist":{"shasum":"4d53d14a8f507cc78062a1af169d60f70c8bd6fd","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.8.1.tgz","integrity":"sha512-SvrJyC0Ha3CLtodGOvcSMosIQzqNRS2Dxvv9kvYsMRLcrPc7LiZYUGKVicdm50w6zswRN9uuqClJgy8C/AtP2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT5dclCVJUVNzfu6msQ6se924rPljQgg3uipM6eX/GoAIhANUN1fLIyChMJJG0cPt54Ps88Vp1oQ11/cE60Wul2MzG"}]},"_from":".","_npmVersion":"1.2.23","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.8.2":{"name":"brauhaus","version":"0.8.2","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.2 <2","coffeelint":">=0.5.6 <1","mocha":"1.9.x","mocha-phantomjs":"2.x","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.34 <0.2","coveralls":">=2.0.7 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 28kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property       | Type   | Default | Description                                       |\n| -------------- | ------ | ------- | ------------------------------------------------- |\n| BURNER_ENERGY  | number | 9000    | Heat source output in kilojoules per hour         |\n| COLOR_NAMES    | array  | ...     | An array of color names for &deg;SRM color ranges |\n| MASH_HEAT_LOSS | number | 5       | Degrees C lost per hour during mash               |\n| ROOM_TEMP      | number | 23      | Room temperature in degrees C                     |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nSerialization\n-------------\nA Brauhaus object can be easily serialized and deserialized from a JSON format. Deserialization can be from a JSON string or an object (i.e. the value given by `JSON.parse(...)`). For example, to serialize and deserialize a recipe object:\n\n```javascript\nvar r, serialized;\n\n// Serialize\nr = new Brauhaus.Recipe(...);\nserialized = JSON.stringify(r);\n\n// Deserialize from JSON string\nserialized = '...';\nr = new Brauhaus.Recipe(serialized);\n\n// Deserialize from parsed object\nserialized = JSON.parse('...');\nr = new Brauhaus.Recipe(serialized);\n```\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration` is unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property        | Type   | Default            | Description                                  |\n| --------------- | ------ | ------------------ | -------------------------------------------- |\n| abv             | number | unset              | Alcohol percentage by volume                 |\n| abw             | number | unset              | Alcohol percentage by weight                 |\n| author          | string | Anonymous Brewer   | Recipe author                                |\n| batchSize       | number | 20.0               | Total size of batch in liters                |\n| boilSize        | number | 10.0               | Size of wort that will be boiled in liters   |\n| brewDayDuration | number | unset              | Duration in minutes for the brew day         |\n| buToGu          | number | unset              | Bitterness units to gravity units ratio      |\n| bv              | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories        | number | unset              | Calories per serving (kcal)                  |\n| color           | number | unset              | Color in &deg;SRM                            |\n| description     | string | Recipe description | Recipe description text                      |\n| fermentables    | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg              | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato         | number | unset              | Final gravity in &deg;Plato                  |\n| ibu             | number | unset              | Bitterness in IBU                            |\n| ibuMethod       | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency  | number | 75.0               | Efficiency percentage for the mash           |\n| name            | number | New recipe         | Recipe name text                             |\n| og              | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato         | number | unset              | Original gravity in &deg;Plato               |\n| price           | number | unset              | Approximate price in USD                     |\n| realExtract     | number | unset              | Real extract of the recipe                   |\n| servingSize     | number | 0.355              | Serving size in liters                       |\n| steepTime       | number | 20                 | Time in minutes to steep ingredients         |\n| spices          | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency | number | 50.0               | Efficiency percentage for steeping           |\n| style           | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| timelineMap     | object | null               | Map used to generate a brew timeline         |\n| yeast           | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.8.2","dist":{"shasum":"c43ca3fd5d9abb11df68e71567adeea64f9999e7","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.8.2.tgz","integrity":"sha512-/S+6uwBcRSKoeM9BbITa72jYs6fVvgUvqe2WRWECI1YN6AK2s5xqie0JFClZ+hi1uXjbZcfs2+b/beUhOmfraw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN/Oz/P4PlY91uQsFjX26UaEb30z07qPVwx7MFKAB2dgIhAOWzAe2qK+6j17c3waUyNCZzPMuWd3PnhFM9Stx9BX/9"}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"0.9.0":{"name":"brauhaus","version":"0.9.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.3 <2","coffeelint":">=0.6.1 <1","mocha":"~1.13.0","mocha-phantomjs":"~3.1.5","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.44 <0.2","coveralls":">=2.3 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 28kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property               | Type   | Default | Description                                          |\n| ---------------------- | ------ | ------- | ---------------------------------------------------- |\n| BURNER_ENERGY          | number | 9000    | Heat source output in kilojoules per hour            |\n| COLOR_NAMES            | array  | ...     | An array of color names for &deg;SRM color ranges    |\n| MASH_HEAT_LOSS         | number | 5       | Degrees C lost per hour during mash                  |\n| RELATIVE_SUGAR_DENSITY | object | ...     | Keys are types of sugar, values are relative density |\n| ROOM_TEMP              | number | 23      | Room temperature in degrees C                        |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\n### Brauhaus.yieldToPpg (number)\nConvert a yield percentage to parts per gallon.\n\n```javascript\n>>> Brauhaus.yieldToPpg(75)\n34.6605\n```\n\n### Brauhaus.ppgToYield (number)\nConvert parts per gallon to a yield percentage.\n\n```javascript\n>>> Brauhaus.ppgToYield(34.6605)\n75.0001\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nSerialization\n-------------\nA Brauhaus object can be easily serialized and deserialized from a JSON format. Deserialization can be from a JSON string or an object (i.e. the value given by `JSON.parse(...)`). For example, to serialize and deserialize a recipe object:\n\n```javascript\nvar r, serialized;\n\n// Serialize\nr = new Brauhaus.Recipe(...);\nserialized = JSON.stringify(r);\n\n// Deserialize from JSON string\nserialized = '...';\nr = new Brauhaus.Recipe(serialized);\n\n// Deserialize from parsed object\nserialized = JSON.parse('...');\nr = new Brauhaus.Recipe(serialized);\n```\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration`, `boilStartTime` and `boilEndTime` are unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property         | Type   | Default            | Description                                  |\n| ---------------- | ------ | ------------------ | -------------------------------------------- |\n| abv              | number | unset              | Alcohol percentage by volume                 |\n| abw              | number | unset              | Alcohol percentage by weight                 |\n| agingDays        | number | 14.0               | Number of days to age keg/bottles            |\n| agingTemp        | number | 20.0               | Temperature during aging in &deg;C           |\n| author           | string | Anonymous Brewer   | Recipe author                                |\n| batchSize        | number | 20.0               | Total size of batch in liters                |\n| boilSize         | number | 10.0               | Size of wort that will be boiled in liters   |\n| boilStartTime    | number | unset              | Time in minutes when the boil starts         |\n| boilEndTime      | number | unset              | Time in minutes when the boil ends           |\n| bottlingPressure | number | 0.0                | Bottle pressure in volumes of CO2            |\n| bottlingTemp     | number | 0.0                | Bottling temperature in &deg;C               |\n| brewDayDuration  | number | unset              | Duration in minutes for the brew day         |\n| buToGu           | number | unset              | Bitterness units to gravity units ratio      |\n| bv               | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories         | number | unset              | Calories per serving (kcal)                  |\n| color            | number | unset              | Color in &deg;SRM                            |\n| description      | string | Recipe description | Recipe description text                      |\n| fermentables     | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg               | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato          | number | unset              | Final gravity in &deg;Plato                  |\n| ibu              | number | unset              | Bitterness in IBU                            |\n| ibuMethod        | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency   | number | 75.0               | Efficiency percentage for the mash           |\n| name             | number | New recipe         | Recipe name text                             |\n| og               | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato          | number | unset              | Original gravity in &deg;Plato               |\n| price            | number | unset              | Approximate price in USD                     |\n| primaryDays      | number | 14.0               | Number of days in primary fermenter          |\n| primaryTemp      | number | 20.0               | Temperature of primary fermenter in &deg;C   |\n| primingCornSugar | number | unset              | Kg of corn sugar to prime                    |\n| primingDme       | number | unset              | Kg of dry malt extract to prime              |\n| primingHoney     | number | unset              | Kg of honey to prime                         |\n| primingSugar     | number | unset              | Kg of (table) sugar to prime                 |\n| realExtract      | number | unset              | Real extract of the recipe                   |\n| secondaryDays    | number | 0.0                | Number of days in secondary fermenter        |\n| secondaryTemp    | number | 0.0                | Temperature of secondary fermenter in &deg;C |\n| servingSize      | number | 0.355              | Serving size in liters                       |\n| steepTime        | number | 20                 | Time in minutes to steep ingredients         |\n| spices           | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency  | number | 50.0               | Efficiency percentage for steeping           |\n| steepTime        | number | 20.0               | Time to steep in minutes                     |\n| style            | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| tertiaryDays     | number | 0.0                | Number of days in tertiary fermenter         |\n| tertiaryTemp     | number | 0.0                | Temperature of tertiary fermenter in &deg;C  |\n| timelineMap      | object | null               | Map used to generate a brew timeline         |\n| yeast            | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nIt is also possible to determine the hop additions relative to the start and end of the boil. This allows you to nicely display the boil additions as relative times (e.g. -60 minutes, -45 minutes, -5 minutes to the end of the boil). Anything before the `boilStartTime` is the mash, steep, or heating to boil, while anything after the `boilEndTime` is chilling, fermentation and bottling. The `brewDayDuration` ends when fermentation begins. The exact point of bottling can be determined with a combination of `brewDayDuration`, `primaryDays`, `secondaryDays`, and `tertiaryDays`.\n\n```javascript\n>>> timeline = r.timeline()\n>>> console.log(r.boilStartTime)\n62.52\n>>> console.log(r.boilEndTime)\n122.52\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@0.9.0","dist":{"shasum":"d89473c752ba5721a0261e356060e18e2dc937f9","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-0.9.0.tgz","integrity":"sha512-yVZwqPh32MnGyMOxHteBJzuCjec5XMP5DiiVJNrc5n8m/zEygPqbRFKeOwO9Z2j1ahWU3neof6xRGpzJvBlMeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7tbGkgDz32xQ2kic4gN24LChNVNZvkFwRYS/9b3BIVgIgT7tUdL0C70APS5Y2zrozZxjpIiOVEYaK/hVWO58zeB4="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"1.0.0":{"name":"brauhaus","version":"1.0.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.3 <2","coffeelint":">=0.6.1 <1","mocha":"~1.13.0","mocha-phantomjs":"~3.1.5","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.44 <0.2","coveralls":">=2.3 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 28kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n * [Recipe diffs (brauhaus-diff)](https://github.com/homebrewing/brauhaus-diff)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n * [Download the latest brauhaus-diff.min.js](https://raw.github.com/homebrewing/brauhaus-diff/master/dist/brauhaus-diff.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property               | Type   | Default | Description                                          |\n| ---------------------- | ------ | ------- | ---------------------------------------------------- |\n| BURNER_ENERGY          | number | 9000    | Heat source output in kilojoules per hour            |\n| COLOR_NAMES            | array  | ...     | An array of color names for &deg;SRM color ranges    |\n| MASH_HEAT_LOSS         | number | 5       | Degrees C lost per hour during mash                  |\n| RELATIVE_SUGAR_DENSITY | object | ...     | Keys are types of sugar, values are relative density |\n| ROOM_TEMP              | number | 23      | Room temperature in degrees C                        |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\n### Brauhaus.yieldToPpg (number)\nConvert a yield percentage to parts per gallon.\n\n```javascript\n>>> Brauhaus.yieldToPpg(75)\n34.6605\n```\n\n### Brauhaus.ppgToYield (number)\nConvert parts per gallon to a yield percentage.\n\n```javascript\n>>> Brauhaus.ppgToYield(34.6605)\n75.0001\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nSerialization\n-------------\nA Brauhaus object can be easily serialized and deserialized from a JSON format. Deserialization can be from a JSON string or an object (i.e. the value given by `JSON.parse(...)`). For example, to serialize and deserialize a recipe object:\n\n```javascript\nvar r, serialized;\n\n// Serialize\nr = new Brauhaus.Recipe(...);\nserialized = JSON.stringify(r);\n\n// Deserialize from JSON string\nserialized = '...';\nr = new Brauhaus.Recipe(serialized);\n\n// Deserialize from parsed object\nserialized = JSON.parse('...');\nr = new Brauhaus.Recipe(serialized);\n```\n\nNote: there is also a [BeerXML plugin](https://github.com/homebrewing/brauhaus-beerxml) available which can serialize / deserialize BeerXML 1.0.\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.bitterness (ibuMethod, earlyOg, batchSize)\nCalculate the IBU of a spice for the given method, early OG, and batch size in liters. Available methods are `'tinseth'` and `'rager'`. The early OG is usually calculated as the sum of gravity values for all non-late fermentables.\n\n```javascript\n>>> s.bitterness('tinseth', 1.045, 19)\n12.4\n```\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.utilizationFactor ()\nGet the utilization factor based on the form of a spice. For example, pellets are easier to utilize than whole leaf hops.\n\n```javascript\n>>> s.utilizationFactor()\n1.15\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration`, `boilStartTime` and `boilEndTime` are unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property         | Type   | Default            | Description                                  |\n| ---------------- | ------ | ------------------ | -------------------------------------------- |\n| abv              | number | unset              | Alcohol percentage by volume                 |\n| abw              | number | unset              | Alcohol percentage by weight                 |\n| agingDays        | number | 14.0               | Number of days to age keg/bottles            |\n| agingTemp        | number | 20.0               | Temperature during aging in &deg;C           |\n| author           | string | Anonymous Brewer   | Recipe author                                |\n| batchSize        | number | 20.0               | Total size of batch in liters                |\n| boilSize         | number | 10.0               | Size of wort that will be boiled in liters   |\n| boilStartTime    | number | unset              | Time in minutes when the boil starts         |\n| boilEndTime      | number | unset              | Time in minutes when the boil ends           |\n| bottlingPressure | number | 0.0                | Bottle pressure in volumes of CO2            |\n| bottlingTemp     | number | 0.0                | Bottling temperature in &deg;C               |\n| brewDayDuration  | number | unset              | Duration in minutes for the brew day         |\n| buToGu           | number | unset              | Bitterness units to gravity units ratio      |\n| bv               | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories         | number | unset              | Calories per serving (kcal)                  |\n| color            | number | unset              | Color in &deg;SRM                            |\n| description      | string | Recipe description | Recipe description text                      |\n| fermentables     | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg               | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato          | number | unset              | Final gravity in &deg;Plato                  |\n| ibu              | number | unset              | Bitterness in IBU                            |\n| ibuMethod        | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency   | number | 75.0               | Efficiency percentage for the mash           |\n| name             | number | New recipe         | Recipe name text                             |\n| og               | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato          | number | unset              | Original gravity in &deg;Plato               |\n| price            | number | unset              | Approximate price in USD                     |\n| primaryDays      | number | 14.0               | Number of days in primary fermenter          |\n| primaryTemp      | number | 20.0               | Temperature of primary fermenter in &deg;C   |\n| primingCornSugar | number | unset              | Kg of corn sugar to prime                    |\n| primingDme       | number | unset              | Kg of dry malt extract to prime              |\n| primingHoney     | number | unset              | Kg of honey to prime                         |\n| primingSugar     | number | unset              | Kg of (table) sugar to prime                 |\n| realExtract      | number | unset              | Real extract of the recipe                   |\n| secondaryDays    | number | 0.0                | Number of days in secondary fermenter        |\n| secondaryTemp    | number | 0.0                | Temperature of secondary fermenter in &deg;C |\n| servingSize      | number | 0.355              | Serving size in liters                       |\n| steepTime        | number | 20                 | Time in minutes to steep ingredients         |\n| spices           | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency  | number | 50.0               | Efficiency percentage for steeping           |\n| steepTime        | number | 20.0               | Time to steep in minutes                     |\n| style            | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| tertiaryDays     | number | 0.0                | Number of days in tertiary fermenter         |\n| tertiaryTemp     | number | 0.0                | Temperature of tertiary fermenter in &deg;C  |\n| timelineMap      | object | null               | Map used to generate a brew timeline         |\n| yeast            | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.scale (newBatchSize, newBoilSize)\nScale a recipe and its ingredients to a new batch size and boil size in liters. Gravity and bitterness units are preserved. This does __not__ recalculate the recipe, it merely adjusts various weights and volumes.\n\n```javascript\n>>> r.scale(10, 6.5)\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nIt is also possible to determine the hop additions relative to the start and end of the boil. This allows you to nicely display the boil additions as relative times (e.g. -60 minutes, -45 minutes, -5 minutes to the end of the boil). Anything before the `boilStartTime` is the mash, steep, or heating to boil, while anything after the `boilEndTime` is chilling, fermentation and bottling. The `brewDayDuration` ends when fermentation begins. The exact point of bottling can be determined with a combination of `brewDayDuration`, `primaryDays`, `secondaryDays`, and `tertiaryDays`.\n\n```javascript\n>>> timeline = r.timeline()\n>>> console.log(r.boilStartTime)\n62.52\n>>> console.log(r.boilEndTime)\n122.52\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@1.0.0","dist":{"shasum":"dc74a733cd4d3b400093136e8fd62c11720463ce","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-1.0.0.tgz","integrity":"sha512-2V/c09GaxAY3AJQXwPs5fFekKxWgD2tGdBKwN5BnU7VExH7VM49FLTOq12IONDvRD1EHypJPtTBfSRkZ1gIrBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICkVFfCNWq/ZRTD415/cCHwYNEuw5GLZD6hfuS2IeMJZAiABySHi1Qs+Q/lJU91TOkxmHcH7k0zemAWf/MnCZPCqkQ=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"}]},"1.1.0":{"name":"brauhaus","version":"1.1.0","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.3 <2","coffeelint":"~1.0.2","mocha":"~1.15.1","mocha-phantomjs":"~3.1.5","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.44 <0.2","coveralls":">=2.3 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Grade recipes based on recipe completeness\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 28kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n * [Recipe diffs (brauhaus-diff)](https://github.com/homebrewing/brauhaus-diff)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n * [Download the latest brauhaus-diff.min.js](https://raw.github.com/homebrewing/brauhaus-diff/master/dist/brauhaus-diff.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property               | Type   | Default | Description                                          |\n| ---------------------- | ------ | ------- | ---------------------------------------------------- |\n| BURNER_ENERGY          | number | 9000    | Heat source output in kilojoules per hour            |\n| COLOR_NAMES            | array  | ...     | An array of color names for &deg;SRM color ranges    |\n| MASH_HEAT_LOSS         | number | 5       | Degrees C lost per hour during mash                  |\n| RELATIVE_SUGAR_DENSITY | object | ...     | Keys are types of sugar, values are relative density |\n| ROOM_TEMP              | number | 23      | Room temperature in degrees C                        |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\n### Brauhaus.yieldToPpg (number)\nConvert a yield percentage to parts per gallon.\n\n```javascript\n>>> Brauhaus.yieldToPpg(75)\n34.6605\n```\n\n### Brauhaus.ppgToYield (number)\nConvert parts per gallon to a yield percentage.\n\n```javascript\n>>> Brauhaus.ppgToYield(34.6605)\n75.0001\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nSerialization\n-------------\nA Brauhaus object can be easily serialized and deserialized from a JSON format. Deserialization can be from a JSON string or an object (i.e. the value given by `JSON.parse(...)`). For example, to serialize and deserialize a recipe object:\n\n```javascript\nvar r, serialized;\n\n// Serialize\nr = new Brauhaus.Recipe(...);\nserialized = JSON.stringify(r);\n\n// Deserialize from JSON string\nserialized = '...';\nr = new Brauhaus.Recipe(serialized);\n\n// Deserialize from parsed object\nserialized = JSON.parse('...');\nr = new Brauhaus.Recipe(serialized);\n```\n\nNote: there is also a [BeerXML plugin](https://github.com/homebrewing/brauhaus-beerxml) available which can serialize / deserialize BeerXML 1.0.\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.bitterness (ibuMethod, earlyOg, batchSize)\nCalculate the IBU of a spice for the given method, early OG, and batch size in liters. Available methods are `'tinseth'` and `'rager'`. The early OG is usually calculated as the sum of gravity values for all non-late fermentables.\n\n```javascript\n>>> s.bitterness('tinseth', 1.045, 19)\n12.4\n```\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.utilizationFactor ()\nGet the utilization factor based on the form of a spice. For example, pellets are easier to utilize than whole leaf hops.\n\n```javascript\n>>> s.utilizationFactor()\n1.15\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration`, `boilStartTime` and `boilEndTime` are unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property         | Type   | Default            | Description                                  |\n| ---------------- | ------ | ------------------ | -------------------------------------------- |\n| abv              | number | unset              | Alcohol percentage by volume                 |\n| abw              | number | unset              | Alcohol percentage by weight                 |\n| agingDays        | number | 14.0               | Number of days to age keg/bottles            |\n| agingTemp        | number | 20.0               | Temperature during aging in &deg;C           |\n| author           | string | Anonymous Brewer   | Recipe author                                |\n| batchSize        | number | 20.0               | Total size of batch in liters                |\n| boilSize         | number | 10.0               | Size of wort that will be boiled in liters   |\n| boilStartTime    | number | unset              | Time in minutes when the boil starts         |\n| boilEndTime      | number | unset              | Time in minutes when the boil ends           |\n| bottlingPressure | number | 0.0                | Bottle pressure in volumes of CO2            |\n| bottlingTemp     | number | 0.0                | Bottling temperature in &deg;C               |\n| brewDayDuration  | number | unset              | Duration in minutes for the brew day         |\n| buToGu           | number | unset              | Bitterness units to gravity units ratio      |\n| bv               | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories         | number | unset              | Calories per serving (kcal)                  |\n| color            | number | unset              | Color in &deg;SRM                            |\n| description      | string | Recipe description | Recipe description text                      |\n| fermentables     | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg               | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato          | number | unset              | Final gravity in &deg;Plato                  |\n| ibu              | number | unset              | Bitterness in IBU                            |\n| ibuMethod        | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency   | number | 75.0               | Efficiency percentage for the mash           |\n| name             | number | New recipe         | Recipe name text                             |\n| og               | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato          | number | unset              | Original gravity in &deg;Plato               |\n| price            | number | unset              | Approximate price in USD                     |\n| primaryDays      | number | 14.0               | Number of days in primary fermenter          |\n| primaryTemp      | number | 20.0               | Temperature of primary fermenter in &deg;C   |\n| primingCornSugar | number | unset              | Kg of corn sugar to prime                    |\n| primingDme       | number | unset              | Kg of dry malt extract to prime              |\n| primingHoney     | number | unset              | Kg of honey to prime                         |\n| primingSugar     | number | unset              | Kg of (table) sugar to prime                 |\n| realExtract      | number | unset              | Real extract of the recipe                   |\n| secondaryDays    | number | 0.0                | Number of days in secondary fermenter        |\n| secondaryTemp    | number | 0.0                | Temperature of secondary fermenter in &deg;C |\n| servingSize      | number | 0.355              | Serving size in liters                       |\n| steepTime        | number | 20                 | Time in minutes to steep ingredients         |\n| spices           | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency  | number | 50.0               | Efficiency percentage for steeping           |\n| steepTime        | number | 20.0               | Time to steep in minutes                     |\n| style            | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| tertiaryDays     | number | 0.0                | Number of days in tertiary fermenter         |\n| tertiaryTemp     | number | 0.0                | Temperature of tertiary fermenter in &deg;C  |\n| timelineMap      | object | null               | Map used to generate a brew timeline         |\n| yeast            | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grade ()\nGrade this recipe's completeness. Returned is a `Number`, where a completely blank recipe is zero and the higher the number, the higher the recipe completeness / quality. Some items carry more weight than others.\n\n```javascript\n>>> r.grade()\n4.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.scale (newBatchSize, newBoilSize)\nScale a recipe and its ingredients to a new batch size and boil size in liters. Gravity and bitterness units are preserved. This does __not__ recalculate the recipe, it merely adjusts various weights and volumes.\n\n```javascript\n>>> r.scale(10, 6.5)\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nIt is also possible to determine the hop additions relative to the start and end of the boil. This allows you to nicely display the boil additions as relative times (e.g. -60 minutes, -45 minutes, -5 minutes to the end of the boil). Anything before the `boilStartTime` is the mash, steep, or heating to boil, while anything after the `boilEndTime` is chilling, fermentation and bottling. The `brewDayDuration` ends when fermentation begins. The exact point of bottling can be determined with a combination of `brewDayDuration`, `primaryDays`, `secondaryDays`, and `tertiaryDays`.\n\n```javascript\n>>> timeline = r.timeline()\n>>> console.log(r.boilStartTime)\n62.52\n>>> console.log(r.boilEndTime)\n122.52\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@1.1.0","dist":{"shasum":"32f0170f4162941c24d13210fc90569b1cee7524","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-1.1.0.tgz","integrity":"sha512-F/EYDm4mP1+30vio66mpTfwpNJs2wCTa6FFPCDMFuPJoONo3Qp7YgTBS1OWjvLWyC69MUJ7lj9lAMQ3NCHGlyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDHe/tuFJeH81md0szcgZslLVXmb4+hwHDEjCfiLPNmHAiB5yxo0bvSX6edj7/DCM/D2dqMCwuzjZCIr1fGZq4Adeg=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},{"name":"jensyt","email":"jensyt@gmail.com"}]},"1.1.1":{"name":"brauhaus","version":"1.1.1","description":"A javascript library for homebrew beer calculations, both in the browser and on the server","homepage":"https://github.com/homebrewing/brauhausjs","main":"lib/brauhaus.js","ender":"lib/brauhaus.js","scripts":{"pretest":"./node_modules/coffee-script/bin/cake build","prepublish":"./node_modules/coffee-script/bin/cake build","test":"./node_modules/coffee-script/bin/cake test"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"bugs":{"url":"https://github.com/homebrewing/brauhausjs/issues"},"keywords":["beer","wine","mead","homebrew","homebrewer","homebrewing","brew","brewer","brewing","malt","sugar","hops","yeast","spice","bacteria","sour","funky","ferment","fermentable","fermenting","fermentation","calculate","calculator","calculation","recipe","instructions","javascript","coffeescript","library","lib"],"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"license":"MIT","dependencies":{},"devDependencies":{"coffee-script":">=1.6.3 <2","coffeelint":"~1.0.2","mocha":"~1.15.1","mocha-phantomjs":"~3.1.5","chai":"1.x","uglify-js":"2.x","istanbul":">=0.1.44 <0.2","coveralls":">=2.3 <3"},"engines":{"node":">=0.6"},"readme":"![Brauhaus.js](https://raw.github.com/homebrewing/brauhausjs/master/img/logo.png)\n\n[![Dependency Status](https://gemnasium.com/homebrewing/brauhausjs.png)](https://gemnasium.com/homebrewing/brauhausjs) [![Build Status](https://travis-ci.org/homebrewing/brauhausjs.png)](https://travis-ci.org/homebrewing/brauhausjs) [![Coverage Status](https://coveralls.io/repos/homebrewing/brauhausjs/badge.png?branch=master)](https://coveralls.io/r/homebrewing/brauhausjs?branch=master) [![NPM version](https://badge.fury.io/js/brauhaus.png)](http://badge.fury.io/js/brauhaus)\n\nA javascript library for homebrew beer calculations both in the browser and on the server. Features include:\n\n * Support for multiple Javascript runtimes\n   * Node.js 0.6.x, 0.8.x, 0.10.x\n   * Chrome, Firefox, Internet Explorer 9+, Safari, Opera, etc\n * Calculate estimated OG, FG, IBU, ABV, SRM color, calories, and more\n * Tinseth and Rager IBU calculation formula support\n   * Pellets vs. whole hops support\n   * Late addition boil support\n   * Dry hopping support\n * Automatically generated recipe instructions and timeline\n * Estimate monetary recipe cost in USD based on ingredients\n * Grade recipes based on recipe completeness\n * Built-in unit conversions (kg <-> lb/oz, liter <-> gallon, temps, etc)\n * Color in &deg;SRM to name, &deg;EBC, &deg;Lovibond, RGB conversions, CSS color, etc\n * Plugin support to add additional features\n * Lightweight - about 28kb when minified\n\nPlugins provide the following features:\n\n * [BeerXML import / export (brauhaus-beerxml)](https://github.com/homebrewing/brauhaus-beerxml)\n * [BJCP style catalog (brauhaus-styles)](https://github.com/homebrewing/brauhaus-styles)\n * [Recipe diffs (brauhaus-diff)](https://github.com/homebrewing/brauhaus-diff)\n\nBrauhaus.js was developed with and for [Malt.io](http://www.malt.io/), a community website for homebrewers to create recipes and share their love of homebrewing beer.\n\nInteractive Examples\n--------------------\n\n * [Basic Example (Javascript)](http://jsfiddle.net/danielgtaylor/wPYGw/)\n * [Basic Example (Coffeescript)](http://jsfiddle.net/danielgtaylor/47Uqu/)\n * [Recipe Timeline (Coffeescript)](http://jsfiddle.net/danielgtaylor/3FEBX/)\n * [BeerXML import (Coffeescript)](http://jsfiddle.net/danielgtaylor/6cj3N/)\n * [BJCP Styles (Coffeescript)](http://jsfiddle.net/danielgtaylor/q5rHF/)\n\nInstallation\n------------\nThere are two ways to use Brauhaus.js - either in a web browser (client-side) or on e.g. Node.js (server-side).\n\n### Web Browser (client-side use)\nTo use Brauhaus.js in a web browser, simply download the following file and include it as you would any other script:\n\n * [Download the latest brauhaus.min.js](https://raw.github.com/homebrewing/brauhausjs/master/dist/brauhaus.min.js)\n\nPlugins:\n\n * [Download the latest brauhaus-beerxml.min.js](https://raw.github.com/homebrewing/brauhaus-beerxml/master/dist/brauhaus-beerxml.min.js)\n * [Download the latest brauhaus-styles.min.js](https://raw.github.com/homebrewing/brauhaus-styles/master/dist/brauhaus-styles.min.js)\n * [Download the latest brauhaus-diff.min.js](https://raw.github.com/homebrewing/brauhaus-diff/master/dist/brauhaus-diff.min.js)\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<!-- Plugins go here... -->\n<script type=\"text/javascript\">\n    // Your code goes here!\n    // See below for an example...\n</script>\n```\n\n### Node.js (server-side use)\nFor Node.js, you can easily install Brauhaus.js and plugins using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (CoffeeScript)\n----------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n# The following line is NOT required for web browser use\nBrauhaus = require 'brauhaus'\n\n# Import plugins here, e.g.\nrequire 'brauhaus-beerxml'\n\n# Create a recipe\nr = new Brauhaus.Recipe\n    name: 'My test brew'\n    description: 'A new test beer using Brauhaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\n# Add ingredients\nr.add 'fermentable',\n    name: 'Extra pale malt'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.add 'hop',\n    name: 'Cascade hops'\n    weight: 0.028\n    aa: 5.0\n    use: 'boil'\n    form: 'pellet'\n\nr.add 'yeast'\n    name: 'Wyeast 3724 - Belgian Saison'\n    type: 'ale'\n    form: 'liquid'\n    attenuation: 80\n\n# Set up a simple infusion mash\nr.mash = new Brauhaus.Mash\n    name: 'My mash'\n    ph: 5.4\n\nr.mash.addStep\n    name: 'Saccharification'\n    type: 'Infusion'\n    time: 60\n    temp: 68\n    waterRatio: 2.75\n\n# Calculate values\nr.calculate()\n\n# Print out calculated values\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Final Gravity: #{ r.fg.toFixed 3 }\"\nconsole.log \"Color: #{ r.color.toFixed 1 }&deg; SRM (#{ r.colorName() })\"\nconsole.log \"IBU: #{ r.ibu.toFixed 1 }\"\nconsole.log \"Alcohol: #{ r.abv.toFixed 1 }% by volume\"\nconsole.log \"Calories: #{ Math.round r.calories } kcal\"\n```\n\nQuick Example (Javascript)\n--------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\n// The following line is NOT required for web browser use\nvar Brauhaus = require('brauhaus');\n\n// Import plugins here, e.g.\nrequire('brauhaus-beerxml');\n\n// Create a recipe\nvar r = new Brauhaus.Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using Brauhaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\n// Add ingredients\nr.add('fermentable', {\n    name: 'Extra pale malt',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.add('hop', {\n    name: 'Cascade hops',\n    weight: 0.028,\n    aa: 5.0,\n    use: 'boil',\n    form: 'pellet'\n});\n\nr.add('yeast', {\n    name: 'Wyeast 3724 - Belgian Saison',\n    type: 'ale',\n    form: 'liquid',\n    attenuation: 80\n});\n\n// Set up a simple infusion mash\nr.mash = new Brauhaus.Mash({\n    name: 'My mash',\n    ph: 5.4\n});\n\nr.mash.addStep({\n    name: 'Saccharification',\n    type: 'Infusion',\n    time: 60,\n    temp: 68,\n    waterRatio: 2.75\n});\n\n// Calculate values\nr.calculate();\n\n// Print out calculated values\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log('Final Gravity: ' + r.fg.toFixed(3));\nconsole.log('Color: ' + r.color.toFixed(1) + '&deg; SRM (' + r.colorName() + ')');\nconsole.log('IBU: ' + r.ibu.toFixed(1));\nconsole.log('Alcohol: ' + r.abv.toFixed(1) + '% by volume');\nconsole.log('Calories: ' + Math.round(r.calories) + ' kcal');\n```\n\nBrauhaus Configuration\n----------------------\nThe following values may be configured and will apply to all recipes, ingredients, etc.\n\n| Property               | Type   | Default | Description                                          |\n| ---------------------- | ------ | ------- | ---------------------------------------------------- |\n| BURNER_ENERGY          | number | 9000    | Heat source output in kilojoules per hour            |\n| COLOR_NAMES            | array  | ...     | An array of color names for &deg;SRM color ranges    |\n| MASH_HEAT_LOSS         | number | 5       | Degrees C lost per hour during mash                  |\n| RELATIVE_SUGAR_DENSITY | object | ...     | Keys are types of sugar, values are relative density |\n| ROOM_TEMP              | number | 23      | Room temperature in degrees C                        |\n\nDuration Functions\n------------------\nThe following functions are available to parse and display durations of time:\n\n### Brauhaus.parseDuration (value)\nParse a string value into a duration in minutes. Supports many optional suffixes like `w`, `wk`, `wks`, `week`, `weeks`, `d`, `day`, `days`, `h`, `hr`, `hrs`, `hour`, `hours`, `m`, `min`, `mins`, `minute`, `minutes`, `s`, `sec`, `second`, and `seconds`.\n\n```javascript\n>>> Brauhaus.parseDuration('2 days')\n2880\n>>> Brauhaus.parseDuration('1hr 3 minutes')\n63\n>>> Brauhaus.parseDuration('12')\n12\n```\n\n### Brauhaus.displayDuration (minutes, [approximate])\nGenerates a human-friendly display string from a number of minutes. Approximate, if set, determines the maximum number of units to return, rounding the last unit. For example, a setting of `2` would return days and hours; or hours and minutes; but never days, hours, and minutes.\n\n```javascript\n>>> Brauhaus.displayDuration(65)\n'1 hour 5 minutes'\n>>> Brauhaus.displayDuration(2833)\n'1 day 23 hours 13 minutes'\n>>> Brauhaus.displayDuration(2833, 2)\n'1 day 23 hours'\n>>> Brauhaus.displayDuration(2833, 1)\n'2 days'\n```\n\nConversion Functions\n--------------------\nThe following functions are available to convert between various forms:\n\n### Brauhaus.kgToLb (number)\nConvert kilograms to pounds.\n\n```javascript\n>>> Brauhaus.kgToLb(2.5)\n5.51155\n```\n\n### Brauhaus.lbToKg (number)\nConvert pounds to kilograms.\n\n```javascript\n>>> Brauhaus.lbToKg(5.51155)\n2.5\n```\n\n### Brauhaus.kgToLbOz (number)\nConvert kilograms to pounds and ounces.\n\n```javascript\n>>> Brauhaus.kgToLbOz(2.5)\n{\n    lb: 5,\n    oz: 8.184799999999996\n}\n```\n\n### Brauhaus.lbOzToKg (numberLbs, numberOz)\nConvert pounds and ounces to kilograms.\n\n```javascript\n>>> Brauhaus.lbOzToKg(5, 8.184799999999996)\n2.5\n```\n\n### Brauhaus.litersToGallons (number)\nConvert liters to gallons.\n\n```javascript\n>>> Brauhaus.litersToGallons(20.0)\n5.283440000000001\n```\n\n### Brauhaus.gallonsToLiters (number)\nConvert gallons to liters.\n\n```javascript\n>>> Brauhaus.gallonsToLiters(5.283440000000001)\n20.0\n```\n\n### Brauhaus.litersPerKgToQuartsPerLb (number)\nConvert l/kg to qt/lb.\n\n```javascript\n>>> Brauhaus.litersPerKgToQuartsPerLb(5.0)\n2.3965285450000002\n```\n\n### Brauhaus.quartsPerLbToLitersPerKg (number)\nConvert qt/lb to l/kg.\n\n```javascript\n>>> Brauhaus.quartsPerLbToLitersPerKg(2.3965285450000002)\n5.0\n```\n\n### Brauhaus.cToF (number)\nConvert a temperature from celcius to fahrenheit.\n\n```javascript\n>>> Brauhaus.cToF(20.0)\n68.0\n```\n\n### Brauhaus.fToC (number)\nConvert a temperature from fahrenheit to celcius.\n\n```javascript\n>>> Brauhaus.fToC(68.0)\n20.0\n```\n\n### Brauhaus.yieldToPpg (number)\nConvert a yield percentage to parts per gallon.\n\n```javascript\n>>> Brauhaus.yieldToPpg(75)\n34.6605\n```\n\n### Brauhaus.ppgToYield (number)\nConvert parts per gallon to a yield percentage.\n\n```javascript\n>>> Brauhaus.ppgToYield(34.6605)\n75.0001\n```\n\nColor Conversions\n-----------------\nColors can be easily converted into various useful formats for the screen and web.\n\n### Brauhaus.srmToEbc (number)\nConvert a color in &deg;SRM to &deg;EBC.\n\n```javascript\n>>> Brauhaus.srmToEbc(10)\n19.7\n```\n\n### Brauhaus.ebcToSrm (number)\nConvert a color in &deg;EBC to &deg;SRM.\n\n```javascript\n>>> Brauhaus.ebcToSrm (20)\n10.16\n```\n\n### Brauhaus.srmToLovibond (number)\nConvert a color in &deg;SRM to &deg;Lovibond.\n\n```javascript\n>>> Brauhaus.srmToLovibond(10)\n7.9433042964712826\n```\n\n### Brauhaus.lovibondToSrm (number)\nConvert a color in &deg;Lovibond to &deg;SRM.\n\n```javascript\n>>> Brauhaus.lovibondToSrm(3.5)\n3.9811000000000005\n```\n\n### Brauhaus.srmToRgb (number)\nConvert a color in &deg;SRM to a RGB triplet.\n\n```javascript\n>>> Brauhaus.srmToRgb(8)\n[208, 88, 13]\n```\n\n### Brauhaus.srmToCss (number)\nConvert a color in &deg;SRM to a form usable in a CSS color string.\n\n```javascript\n>>> Brauhaus.srmToCss(8)\n'rgb(208, 88, 14)'\n```\n\n### Brauhaus.srmToName (number)\nConvert a color in &deg;SRM to a human-readable color.\n\n```javascript\n>>> Brauhaus.srmToName(8)\n'deep gold'\n```\n\nOther Utilities\n---------------\n\n### Brauhaus.timeToHeat (liters, degrees)\nGet the time in minutes to heat a volume of water in liters by a number of degrees C given the heat source defined by `Brauhaus.BURNER_ENERGY`.\n\n```javascript\n>>> Brauhaus.timeToHeat(10.0, 80.0)\n22.34666666666667\n```\n\nBrauhaus Objects\n----------------\nThe following list of objects are available within Brauhaus:\n\n * Fermentable\n * Spice\n * Yeast\n * MashStep\n * Mash\n * Recipe\n\nSerialization\n-------------\nA Brauhaus object can be easily serialized and deserialized from a JSON format. Deserialization can be from a JSON string or an object (i.e. the value given by `JSON.parse(...)`). For example, to serialize and deserialize a recipe object:\n\n```javascript\nvar r, serialized;\n\n// Serialize\nr = new Brauhaus.Recipe(...);\nserialized = JSON.stringify(r);\n\n// Deserialize from JSON string\nserialized = '...';\nr = new Brauhaus.Recipe(serialized);\n\n// Deserialize from parsed object\nserialized = JSON.parse('...');\nr = new Brauhaus.Recipe(serialized);\n```\n\nNote: there is also a [BeerXML plugin](https://github.com/homebrewing/brauhaus-beerxml) available which can serialize / deserialize BeerXML 1.0.\n\nBrauhaus.Fermentable\n--------------------\nA fermentable is some kind of a sugar that yeast can metabolize into CO2 and alcohol. Fermentables can be malts, malt extracts, honey, sugar, etc. Each fermentable can have the following properties:\n\n| Property | Type   | Default         | Description             |\n| -------- | ------ | --------------- | ----------------------- |\n| color    | number | 2.0             | Color in &deg;SRM       |\n| late     | bool   | false           | Late addition           |\n| name     | string | New fermentable | Name of the fermentable |\n| weight   | number | 1.0             | Weight in kilograms     |\n| yield    | number | 75.0            | Percentage yield        |\n\n### Fermentable.prototype.addition ()\nGet the addition type of fermentable, one of `mash`, `steep`, or `boil`.\n\n```javascript\n>>> f.addition()\n'steep'\n```\n\n### Fermentable.prototype.colorRgb ()\nGet the color triplet for this fermentable. Shortcut for `Brauhaus.srmToRgb(f.color)`.\n\n```javascript\n>>> f.colorRgb()\n[233, 157, 63]\n```\n\n### Fermentable.prototype.colorCss ()\nGet the CSS-friendly color string for this fermentable. Shortcut for `Brauhaus.srmToCss(f.color)`.\n\n```javascript\n>>> f.colorCss()\n'rgb(233, 157, 63)'\n```\n\n### Fermentable.prototype.colorName ()\nGet the human-readable name for the color of this fermentable. Shortcut for `Brauhaus.srmToName(f.color)`.\n\n```javascript\n>>> f.colorName()\n'deep gold'\n```\n\n### Fermentable.prototype.gu (number)\nGet the gravity units of this fermentable for a number of liters, based on the weight and yield. These units make the original gravity when divided by 1000 and added to one.\n\n```javascript\n>>> f.gu(20.0)\n32\n```\n\n### Fermentable.prototype.plato (number)\nGet the gravity in degrees plato for this fermentable for a number of liters, based on the weight and yield.\n\n```javascript\n>>> f.plato(20.0)\n7.5301\n```\n\n### Fermentable.prototype.ppg ()\nGet the parts per gallon from the yield percentage.\n\n```javascript\n>>> f.ppg()\n36\n```\n\n### Fermentable.prototype.price ()\nGuess the price in USD per kilogram of this fermentable, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> f.price()\n13.5025\n```\n\n### Fermentable.prototype.type ()\nGet the type of fermentable, either `extract` or `grain`.\n\n```javascript\n>>> f.type()\n'grain'\n```\n\n### Fermentable.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(f.weight)` to get the weight in pounds.\n\n```javascript\n>>> f.weightLb()\n2.2\n```\n\n### Fermentable.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(f.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> f.weightLbOz()\n{\n    lb: 2,\n    oz: 4.3\n}\n```\n\nBrauhaus.Spice\n--------------\nA spice is some kind of substance added to flavor or protect a brew. Spices can be hops, coriander, orange peel, cinnamon, whirlfloc, Irish moss, rose hips, etc. Each spice can have the following properties:\n\n| Property | Type   | Default   | Description                                      |\n| -------- | ------ | --------- | ------------------------------------------------ |\n| aa       | number | 0.0       | Alpha-acid percentage (0 - 100)                  |\n| form     | string | pellet    | Form, like pellet, whole, ground, crushed, etc   |\n| name     | string | New spice | Name of the spice                                |\n| time     | number | 60        | Time in minutes to add the spice                 |\n| use      | string | boil      | When to use the spice (mash, boil, primary, etc) |\n| weight   | number | 1.0       | Weight in kilograms                              |\n\n### Spice.prototype.bitterness (ibuMethod, earlyOg, batchSize)\nCalculate the IBU of a spice for the given method, early OG, and batch size in liters. Available methods are `'tinseth'` and `'rager'`. The early OG is usually calculated as the sum of gravity values for all non-late fermentables.\n\n```javascript\n>>> s.bitterness('tinseth', 1.045, 19)\n12.4\n```\n\n### Spice.prototype.dry ()\nTrue if the spice is added after the boil, otherwise false. This is useful for determining if dry hopping is taking place.\n\n```javascript\n>>> s.dry()\nfalse\n```\n\n### Spice.prototype.price ()\nGuess the price in USD per kilogram of this spice, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> s.price()\n2.5318\n```\n\n### Spice.prototype.utilizationFactor ()\nGet the utilization factor based on the form of a spice. For example, pellets are easier to utilize than whole leaf hops.\n\n```javascript\n>>> s.utilizationFactor()\n1.15\n```\n\n### Spice.prototype.weightLb ()\nA shortcut for `Brauhaus.kgToLb(s.weight)` to get the weight in pounds.\n\n```javascript\n>>> s.weightLb()\n0.0625\n```\n\n### Spice.prototype.weightLbOz ()\nA shortcut for `Brauhaus.kgToLbOz(s.weight)` to get the weight in pounds and ounces.\n\n```javascript\n>>> s.weightLbOz()\n{\n    lb: 0,\n    oz: 1\n}\n```\n\nBrauhaus.Yeast\n--------------\nYeast are the biological workhorse that transform sugars into alcohol. Yeast can be professional strains like Wyeast 3068, harvested from bottles, harvested from the air, or other bugs like bacteria that produce acid.\n\n| Property    | Type   | Default   | Description                                |\n| ----------- | ------ | --------- | ------------------------------------------ |\n| attenuation | number | 75.0      | Percentage of sugars the yeast can convert |\n| form        | string | liquid    | Liquid or dry                              |\n| name        | string | New yeast | Name of the yeast                          |\n| type        | string | ale       | Ale, lager, or other                       |\n\n### Yeast.prototype.price ()\nGuess the price in USD per packet of this yeast, based on the name. Prices are an approximation based on multiple online homebrew supply store prices. You should use `toFixed(2)` to display these.\n\n```javascript\n>>> y.price()\n7\n```\n\nBrauhaus.MashStep\n-----------------\nA single step in a multi-step mash, such as infusing water, changing the temperature, or decocting mash to boil.\n\n| Property    | Type   | Default          | Description                                                  |\n| ----------- | ------ | ---------------- | ------------------------------------------------------------ |\n| endTemp     | number | unset            | Temperature in degrees C after this step                     |\n| name        | string | Saccharification | A name to give this step                                     |\n| rampTime    | number | unset            | Time in minutes to ramp to the given temperature             |\n| temp        | number | 68               | Temperature in degrees C to hold the mash                    |\n| time        | number | 60               | Duration of this step in minutes                             |\n| type        | string | Infusion         | Type of mash step: `Infusion`, `Temperature`, or `Decoction` |\n| waterRatio  | number | 3.0              | Ratio in liters per kg of water to infuse or decoct          |\n\n### MashStep.types\nAn array of available mash step types: `Infusion`, `Temperature`, and `Decoction`. They can generally be broken down as follows:\n\n * `Infusion`: adding hot water to the mash to raise its overall temperature\n * `Temperature`: usually adding heat via some source, like a stovetop or gas burner\n * `Decoction`: removing and boiling some of the mash, then adding it back to raise the overall temperature\n\n---\n\n### MashStep.prototype.description ([boolean], [number])\nAn automatically generated description of the step. If the first argument is `true`, then use SI units (liters, kilograms, celcius). If it is `false`, then use quarts, pounds and fahrenheit. If a second argument is passed, then it is used as the total grain weight of the recipe to determine the exact amount of water or mash to add/remove.\n\n```javascript\n>>> mashStep.description()\n'Infuse 3.0l per kg of grain for 60 minutes at 68C'\n>>> mashStep.description(false)\n'Infuse 1.44qt per lb of grain for 60 minutes at 154.4F'\n>>> mashStep.description(true, 3.3)\n'Infuse 10.0l for 60 minutes at 68C'\n>>> mashStep.description(false, 3.3)\n'Infuse 10.57qt for 60 minutes at 154.4F'\n```\n\n### MashStep.prototype.endTempF ()\nGet the step end temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.endTemp)`.\n\n```javascript\n>>> mashStep.endTempF()\n150.0\n```\n\n### MashStep.prototype.tempF ()\nGet the step temperature in degrees F. Shortcut for `Brauhaus.cToF(mashStep.temp)`.\n\n```javascript\n>>> mashStep.tempF()\n154.0\n```\n\n### MashStep.prototype.waterRatioQtPerLb ()\nGet the water ratio in quarts per pound of grain. Shortcut for `Brauhaus.litersPerKgToQtPerLb(mashStep.waterRatio)`.\n\n```javascript\n>>> mashStep.waterRatioQtPerLb()\n1.5\n```\n\nBrauhaus.Mash\n-------------\nA recipe mash description for all-grain or partial-mash recipes. The mash includes information like a name, notes for the brewer, grain temperature, PH, etc.\n\n| Property   | Type   | Default | Description                                        |\n| ---------- | ------ | ------- | -------------------------------------------------- |\n| grainTemp  | number | 23      | Grain temperature in degrees C                     |\n| name       | string | unset   | Name of the mash, e.g. `Single step infusion @68C` |\n| notes      | string | unset   | Notes for the brewer                               |\n| ph         | number | unset   | Target PH of the mash                              |\n| spargeTemp | number | 76      | Sparge temperature in degrees C                    |\n| steps      | array  | []      | A list of `Brauhaus.MashStep` objects              |\n\n### Mash.prototype.addStep (object)\nAdd a new mash step with the passed options.\n\n```javascript\n>>> mash.prototype.addStep({\n    name: 'Test step',\n    type: 'Infusion',\n    waterRatio: 3.0,\n    temp: 68,\n    time: 60\n})\n```\n\n### Mash.prototype.grainTempF ()\nGet the grain temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.grainTemp)`.\n\n```javascript\n>>> mash.grainTempF()\n75.0\n```\n\n### Mash.prototype.spargeTempF ()\nGet the sparge temperature in degrees F. Shortcut for `Brauhaus.cToF(mash.spargeTemp)`.\n\n```javascript\n>>> mash.spargeTempF()\n170.0\n```\n\nBrauhaus.Recipe\n---------------\nA beer recipe, containing ingredients like fermentables, spices, and yeast. Calculations can be made for bitterness, alcohol content, color, and more. Many values are unset by default and will be calculated when the `Recipe.prototype.calculate()` method is called. The `brewDayDuration`, `boilStartTime` and `boilEndTime` are unset until the `Recipe.prototype.timeline()` method is called.\n\n| Property         | Type   | Default            | Description                                  |\n| ---------------- | ------ | ------------------ | -------------------------------------------- |\n| abv              | number | unset              | Alcohol percentage by volume                 |\n| abw              | number | unset              | Alcohol percentage by weight                 |\n| agingDays        | number | 14.0               | Number of days to age keg/bottles            |\n| agingTemp        | number | 20.0               | Temperature during aging in &deg;C           |\n| author           | string | Anonymous Brewer   | Recipe author                                |\n| batchSize        | number | 20.0               | Total size of batch in liters                |\n| boilSize         | number | 10.0               | Size of wort that will be boiled in liters   |\n| boilStartTime    | number | unset              | Time in minutes when the boil starts         |\n| boilEndTime      | number | unset              | Time in minutes when the boil ends           |\n| bottlingPressure | number | 0.0                | Bottle pressure in volumes of CO2            |\n| bottlingTemp     | number | 0.0                | Bottling temperature in &deg;C               |\n| brewDayDuration  | number | unset              | Duration in minutes for the brew day         |\n| buToGu           | number | unset              | Bitterness units to gravity units ratio      |\n| bv               | number | unset              | Balance value (bitterness / sweetness ratio) |\n| calories         | number | unset              | Calories per serving (kcal)                  |\n| color            | number | unset              | Color in &deg;SRM                            |\n| description      | string | Recipe description | Recipe description text                      |\n| fermentables     | array  | []                 | Array of `Brauhaus.Fermentable` objects      |\n| fg               | number | unset              | Final gravity (e.g. 1.012)                   |\n| fgPlato          | number | unset              | Final gravity in &deg;Plato                  |\n| ibu              | number | unset              | Bitterness in IBU                            |\n| ibuMethod        | string | tinseth            | IBU calculation method, `tinseth` or `rager` |\n| mashEfficiency   | number | 75.0               | Efficiency percentage for the mash           |\n| name             | number | New recipe         | Recipe name text                             |\n| og               | number | unset              | Original gravity (e.g. 1.048)                |\n| ogPlato          | number | unset              | Original gravity in &deg;Plato               |\n| price            | number | unset              | Approximate price in USD                     |\n| primaryDays      | number | 14.0               | Number of days in primary fermenter          |\n| primaryTemp      | number | 20.0               | Temperature of primary fermenter in &deg;C   |\n| primingCornSugar | number | unset              | Kg of corn sugar to prime                    |\n| primingDme       | number | unset              | Kg of dry malt extract to prime              |\n| primingHoney     | number | unset              | Kg of honey to prime                         |\n| primingSugar     | number | unset              | Kg of (table) sugar to prime                 |\n| realExtract      | number | unset              | Real extract of the recipe                   |\n| secondaryDays    | number | 0.0                | Number of days in secondary fermenter        |\n| secondaryTemp    | number | 0.0                | Temperature of secondary fermenter in &deg;C |\n| servingSize      | number | 0.355              | Serving size in liters                       |\n| steepTime        | number | 20                 | Time in minutes to steep ingredients         |\n| spices           | array  | []                 | Array of `Brauhaus.Spice` objects            |\n| steepEfficiency  | number | 50.0               | Efficiency percentage for steeping           |\n| steepTime        | number | 20.0               | Time to steep in minutes                     |\n| style            | object | null               | Recipe style (see `Brauhaus.STYLES`)         |\n| tertiaryDays     | number | 0.0                | Number of days in tertiary fermenter         |\n| tertiaryTemp     | number | 0.0                | Temperature of tertiary fermenter in &deg;C  |\n| timelineMap      | object | null               | Map used to generate a brew timeline         |\n| yeast            | array  | []                 | Array of `Brauhaus.Yeast` objects            |\n\n### Recipe.prototype.add (type, data)\nAdd a new ingredient to the recipe. `type` can be one of `fermentable`, `hop`, `spice`, or `yeast`. The data is what will be sent to the constructor of the ingredient defined by `type`.\n\n```javascript\n>>> r.add('fermentable', {\n    name: 'Pale malt',\n    weight: 4.0,\n    yield: 75,\n    color: 3.5\n});\n>>> r.fermentables\n[<Brauhaus.Fermentable object 'Pale malt'>]\n\n>>> r.add('hop', {\n   name: 'Cascade',\n   weight: 0.028,\n   time: 60,\n   aa: 5.3,\n   form: 'pellet'\n});\n\n>>> r.add('spice', {\n    name: 'Coriander',\n    weight: 0.014\n    time: 5\n    form: 'ground'\n});\n\n>>> r.add('yeast', {\n   name: 'Wyeast 3056'\n   type: 'ale'\n   form: 'liquid'\n   attenuation: 75\n});\n```\n\n### Recipe.prototype.batchSizeGallons ()\nGet the recipe batch size in gallons. Shortcut for `Brauhaus.litersToGallons(r.batchSize)`.\n\n```javascript\n>>> r.batchSizeGallons()\n5.025\n```\n\n### Recipe.prototype.boilSizeGallons ()\nGet the recipe boil size in gallons. Shortcut for `Brauhaus.litersToGallons(r.boilSize)`.\n\n```javascript\n>>> r.boilSizeGallons()\n3.125\n```\n\n### Recipe.prototype.bottleCount ()\nGet the total number of whole bottles (i.e. servings) for this recipe. This is a shortcut that is equivalent to `Math.floor(r.batchSize / r.servingSize)`.\n\n```javascript\n>>> r.bottleCount()\n56\n```\n\n### Recipe.prototype.calculate ()\nCalculate alcohol, bitterness, color, gravities, etc. This method must be called before trying to access those values. See the quick examples above for a more complete example of `calculate()` usage.\n\n```javascript\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.grade ()\nGrade this recipe's completeness. Returned is a `Number`, where a completely blank recipe is zero and the higher the number, the higher the recipe completeness / quality. Some items carry more weight than others.\n\n```javascript\n>>> r.grade()\n4.5\n```\n\n### Recipe.prototype.grainWeight ()\nGet the total grain weight in kg. Note that this only includes fermentables that are mashed or steeped. Things like malt extract syrup are excluded.\n\n```javascript\n>>> r.grainWeight()\n4.0\n```\n\n### Recipe.prototype.scale (newBatchSize, newBoilSize)\nScale a recipe and its ingredients to a new batch size and boil size in liters. Gravity and bitterness units are preserved. This does __not__ recalculate the recipe, it merely adjusts various weights and volumes.\n\n```javascript\n>>> r.scale(10, 6.5)\n>>> r.calculate()\n>>> r.ibu\n28.5\n```\n\n### Recipe.prototype.timeline (siUnits=true)\nGenerate a brew timeline from a recipe. If `siUnits` is `true`, then generate the timeline in metric units, otherwise output imperial units. Returns a list of `[duration, description]` items where `duration` is a time in minutes from the start of the recipe and `description` is the step description text.\n\n```javascript\n>>> r.timeline()\n[\n    [0, 'Heat 10l of water to 68C (about 20 minutes)'],\n    [20, 'Add 1kg CaraMunich (10 GU) and steep for 20 minutes'],\n    [40.16, 'Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)'],\n    [62.52, 'Add 28g of Cascade hops (30 IBU)'],\n    ...\n]\n```\n\nIt's possible to display a human-friendly version of this information with some utility methods used in a loop. For example:\n\n```javascript\n>>> timeline = r.timeline()\n>>> for (var x = 0; x < timeline.length; x++) {\n>>>     var duration = timeline[x][0];\n>>>     var description = timeline[x][1];\n>>>     console.log(Brauhaus.displayDuration(duration, 2) + ': ' + description);\n>>> }\nstart: Heat 10l of water to 68C (about 20 minutes)\n20 minutes: Add 1kg CaraMunich (10 GU) and steep for 20 minutes\n40 minutes: Remove grains. This is now your wort. Top up to 10l and bring to a boil (about 12 minutes)\n63 minutes: Add 28g of Cascade hops (30 IBU)\n...\n```\n\nIt is also possible to determine the hop additions relative to the start and end of the boil. This allows you to nicely display the boil additions as relative times (e.g. -60 minutes, -45 minutes, -5 minutes to the end of the boil). Anything before the `boilStartTime` is the mash, steep, or heating to boil, while anything after the `boilEndTime` is chilling, fermentation and bottling. The `brewDayDuration` ends when fermentation begins. The exact point of bottling can be determined with a combination of `brewDayDuration`, `primaryDays`, `secondaryDays`, and `tertiaryDays`.\n\n```javascript\n>>> timeline = r.timeline()\n>>> console.log(r.boilStartTime)\n62.52\n>>> console.log(r.boilEndTime)\n122.52\n```\n\nContributing\n------------\nContributions are welcome - just fork the project and submit a pull request when you are ready!\n\n### Getting Started\nFirst, create a fork on GitHub. Then:\n\n```bash\ngit clone ...\ncd brauhausjs\nnpm install\n```\n\n### Style Guide\nBrauhaus uses the [CoffeeScript Style Guide](https://github.com/polarmobile/coffeescript-style-guide) with the following exceptions:\n\n 1. Indent 4 spaces\n 1. Maximum line length is 120 characters\n\nWhen building `brauhaus.js` with `cake build` or `npm test` you will see the output of [CoffeeLint](http://www.coffeelint.org/), a static analysis code quality tool for CoffeeScript. Please adhere to the warnings and errors to ensure your changes will build.\n\n### Unit Tests\nBefore submitting a pull request, please add any relevant tests and run them via:\n\n```bash\nnpm test\n```\n\nIf you have PhantomJS installed and on your path then you can use:\n\n```bash\nCI=true npm test\n```\n\nPull requests will automatically be tested by Travis CI both in Node.js 0.6/0.8/0.10 and in a headless webkit environment (PhantomJS). Changes that cause tests to fail will not be accepted. New features should be tested to be accepted.\n\nNew tests can be added in the `test` directory. If you add a new file there, please don't forget to update the `test.html` to include it!\n\n### Code Coverage\nYou can generate a unit test code coverage report for unit tests using the following:\n\n```bash\ncake coverage\n```\n\nYou can find an HTML report in the `coverage` directory that is created. This report will show line-by-line code coverage information.\n\n---\n\nPlease note that all contributions will be licensed under the MIT license in the following section.\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"brauhaus@1.1.1","dist":{"shasum":"853cc621ee7e338fcb6be320e9f45a2b6dec2479","tarball":"https://registry.npmjs.org/brauhaus/-/brauhaus-1.1.1.tgz","integrity":"sha512-E45vDMYmUsp7sxYSoKBj3b6Gu1YJWinEoIvPUrZSHyn2QPlgeFuGajfNdaz3OtY3fvfdTNkfl1xsoROTBq6TjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQXjn1jiuBOStr/RUEdqBqRKlFX1KkzH0a5sPQ6RON1gIhAPxCZGsyGZlVGB1V+1CwEsfQ0K/s//wgzUiDrwyVHrtJ"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},"maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},{"name":"jensyt","email":"jensyt@gmail.com"}]}},"readme":"BrauHaus.js\n===========\nA library for homebrew beer calculations using Node.js or a web browser. Features:\n\n * BeerXML import / export\n * Calculate OG, FG, IBU, ABV, and color\n * Automatically generated recipe instructions\n * Color to RGB conversions, CSS color support, etc\n\n[![Build Status](https://travis-ci.org/danielgtaylor/brauhausjs.png?branch=master)](https://travis-ci.org/danielgtaylor/brauhausjs)\n\nInstallation\n------------\nYou can install BrauHaus.js using `npm`:\n\n```bash\nnpm install brauhaus\n```\n\nQuick Example (browser)\n-----------------------\nHere is an example of how to use the library in a browser. Be sure to copy the `lib/brauhaus.min.js` file onto the web server. This example assumes it is accessible via `/scripts/brauhaus.min.js`:\n\n```html\n<script type=\"text/javascript\" src=\"/scripts/brauhaus.min.js\"></script>\n<script type=\"text/javascript\">\n    var r = new BrauHaus.Recipe({\n        name: 'My test brew',\n        description: 'A new test beer using BrauHaus.js!',\n        batchSize: 20.0,\n        boilSize: 10.0\n    });\n\n    r.add('fermentable', {\n        name: 'Extra pale liquid extract',\n        color: 2.5,\n        weight: 4.2,\n        yield: 78.0\n    });\n\n    r.calculate();\n\n    console.log('Original Gravity: ' + r.og.toFixed(3));\n    console.log 'Alcohol: ' + r.abv + ' by volume'));\n</script>\n```\n\nQuick Example (Node.js CoffeeScript)\n------------------------------------\nHere is an example of how to use the library from CoffeeScript:\n\n```coffeescript\n{Recipe} = require 'brauhaus'\n\nr = new Recipe\n    name: 'My test brew'\n    description: 'A new test beer using BrauHaus.js!'\n    batchSize: 20.0\n    boilSize: 10.0\n\nr.add 'fermentable',\n    name: 'Extra pale liquid extract'\n    color: 2.5\n    weight: 4.2\n    yield: 78.0\n\nr.calculate()\n\nconsole.log \"Original Gravity: #{ r.og.toFixed 3 }\"\nconsole.log \"Alcohol: #{ r.abv }% by volume\"\n```\n\nQuick Example (Node.js Javascript)\n----------------------------------\nHere is an example of how to use the library form Javascript:\n\n```javascript\nRecipe = require('brauhaus').Recipe\n\nvar r = new Recipe({\n    name: 'My test brew',\n    description: 'A new test beer using BrauHaus.js!',\n    batchSize: 20.0,\n    boilSize: 10.0\n});\n\nr.add('fermentable', {\n    name: 'Extra pale liquid extract',\n    color: 2.5,\n    weight: 4.2,\n    yield: 78.0\n});\n\nr.calculate();\n\nconsole.log('Original Gravity: ' + r.og.toFixed(3));\nconsole.log 'Alcohol: ' + r.abv + ' by volume'));\n```\n\nReference\n---------\nComing soon...\n\nLicense\n-------\nCopyright (c) 2013 Daniel G. Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"danielgtaylor","email":"danielgtaylor@gmail.com"},{"name":"jensyt","email":"jensyt@gmail.com"}],"time":{"modified":"2022-06-13T05:04:59.883Z","created":"2013-02-04T01:45:29.947Z","0.0.4":"2013-02-04T01:45:30.982Z","0.0.6":"2013-02-05T07:18:23.757Z","0.0.7":"2013-02-06T16:31:05.672Z","0.0.8":"2013-02-08T05:12:41.707Z","0.0.9":"2013-02-09T19:29:27.133Z","0.1.1":"2013-02-11T05:48:46.860Z","0.1.2":"2013-02-11T16:52:41.690Z","0.1.3":"2013-02-15T05:41:33.401Z","0.1.5":"2013-02-16T23:38:44.056Z","0.1.6":"2013-02-17T01:22:11.626Z","0.1.7":"2013-03-01T06:35:55.508Z","0.1.8":"2013-03-01T06:47:37.595Z","0.1.9":"2013-03-01T15:50:45.500Z","0.2.0":"2013-03-01T17:01:04.372Z","0.2.1":"2013-04-17T16:47:28.524Z","0.2.2":"2013-04-18T06:25:41.773Z","0.2.3":"2013-04-21T01:58:24.354Z","0.2.4":"2013-04-26T01:00:37.529Z","0.3.0":"2013-05-01T15:34:59.149Z","0.3.1":"2013-05-03T15:43:48.323Z","0.3.2":"2013-05-15T03:11:33.391Z","0.4.0":"2013-05-15T15:27:26.363Z","0.5.0":"2013-05-20T05:43:21.660Z","0.5.1":"2013-05-24T01:13:43.283Z","0.5.2":"2013-05-25T18:14:21.278Z","0.5.3":"2013-06-16T19:57:19.619Z","0.5.4":"2013-06-20T01:04:34.431Z","0.6.0":"2013-06-22T06:03:14.409Z","0.7.0":"2013-06-22T21:12:30.169Z","0.8.0":"2013-06-25T05:19:25.859Z","0.8.1":"2013-07-03T03:27:23.317Z","0.8.2":"2013-08-08T01:35:19.238Z","0.9.0":"2013-10-28T04:54:52.327Z","1.0.0":"2013-11-08T07:45:07.942Z","1.1.0":"2013-12-07T23:00:05.755Z","1.1.1":"2013-12-20T05:12:48.861Z"},"author":{"name":"Daniel G. Taylor","email":"danielgtaylor@gmail.com","url":"https://github.com/homebrewing"},"repository":{"type":"git","url":"https://github.com/homebrewing/brauhausjs"},"users":{"strathausen":true}}