JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q50729F

A small library providing utility methods to calculate bitterness ibu of brew recipe

Package Exports

  • bitterness

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bitterness) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Bitterness

Build Status

A basic library providing utility methods to calculate bitterness of a given recipe, in IBU measure unit, featuring Rager forumula, Tinseth formula or an average of the two, Garetz formula is also available. Measure system is defaulted at European decimal system, supports Imperial system too.

Installation

npm install bitterness
# for development purpose install (e.g. running tests) need mocha and chai
npm install bitterness --dev

Usage

var bt = require('bitterness');
// ibu value with Rager formula
var rager = bt.rager(
        hopWeight, // grams of hop
        time, // time in minutes
        alphaAcids, // AA% in the form of % (e.g. 6% => 6)
        batchSize, // size of the batch in liters
        originalGravity); // OG in the form xxxx.xx (e.g. 1050.00)
// ibu value with Tinseth formula
var tinseth = bt.tinseth(
        hopWeight, // grams of hop
        time, // time in minutes
        alphaAcids, // AA% in the form of % (e.g. 6% => 6)
        batchSize, // size of the batch in liters
        originalGravity); // OG in the form xxxx.xx (e.g. 1050.00)
// ibu value using Garetz formula
var garetz = bt.garetz(
        hopWeight, // grams of hop
        time, // time in minutes
        alphaAcids, // AA% in the form of % (e.g. 6% => 6)
        batchSize, // size of the batch in liters
        originalGravity, // OG in the form xxxx.xx (e.g. 1050.00)
        final_volume // size of the volume post boil in liters
        height); // height in meters of the boiling batch

Practical example:

var bt = require('bitterness');
var rager = bt.rager;
// 93 grams, 90 minutes boil time, 6% alpha acids, 25 liters batch, 1050 og
var r = rager(93, 90, 6, 25, 1050);
var g = bt.garetz(93, 90, 6, 25, 1050); // using defaulted final volume = (batch size - 10%) and height = 0

console.log(r); // ~ 71 ibu
console.log(g); // ~ 49 ibu

bt.setMetricSystem(false); // set system to imperial
// 3.17 oz, 90 minutes, 6% alpha acids, 6.60 gallons, 1050 og
var r = rager(3.17, 90, 6, 6.60, 1050);

Test

npm test

Changelog

See the CHANGELOG file.

License

See the LICENSE-MIT file for license rights and limitations (MIT).