{"_id":"@alehuo/coffee-ratio","_rev":"3-d0bb0bf76108bfcc7f1e8f0357f48447","name":"@alehuo/coffee-ratio","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@alehuo/coffee-ratio","version":"1.0.0","description":"Coffee ratio calculator","main":"dist/src/index.js","typings":"dist/src/index.d.ts","private":false,"scripts":{"test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"keywords":[],"author":{"name":"Aleksi Huotala","email":"alehuo@pm.me"},"license":"MIT","devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@babel/preset-typescript":"^7.12.1","@types/jest":"^26.0.15","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0","babel-jest":"^26.6.1","eslint":"^7.12.1","eslint-config-standard":"^16.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.2.1","jest":"^26.6.1","typescript":"^4.0.5"},"gitHead":"5cc29113f76a336a59d295d3ea6bbcdb9f4e74a0","_id":"@alehuo/coffee-ratio@1.0.0","_nodeVersion":"10.16.2","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TVZFP6gtuFYauod1/RYRgWVu906lNL0pm28llbNN2T6l2+fgalSLcC43tI0bTmbEKo1K7MEn5gHDjEffo86MKA==","shasum":"8c74dda38eb02e98526b52aa22405fd708df44f8","tarball":"https://registry.npmjs.org/@alehuo/coffee-ratio/-/coffee-ratio-1.0.0.tgz","fileCount":22,"unpackedSize":44828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfolWcCRA9TVsSAnZWagAA5ZoP/A0Xangvp/NfGKWjb2+K\nN6aZJT6IoD/2UvA7kbwv67Ba1wkANNrG3q7QrE94vB6kR9Z/WS29BOyoP2/3\nD+GNdfopcbjSkDXTvbTZohCAHmPNk98CZ1q0Lup8EQ+ZzZZzzIihymdXPi5g\nOl4XBUuw9AV7mkfjRaKvNI0XRMLnC56zhv+CXFueSBZTc+p/QBktjpkToTu2\nRjQe5WPSktTrmJQ0w+8QWwc+O9IJBmI4H5yxkxZwivFZfIBWIx2cb1OabcUa\niwU2Y9rp8SpzlnZiTGnXUAOFCd6iRIeQdjoVt7dzMWkQGN0uflqCmY+VlB78\nDguskax6TFYp11TtBhxK30BnxdLtYbKRdLtrw62ea0t4cv2rwe1AaRA8OOuc\n5HFNoljj/B0zj5voTf02AMvpYuOJWYpV/XVlUaWbcKNIju3h592M2bEpVWvI\n/Mr93rAUlx0oW81ynop+8DIebVZGw+ljPtfHUlp+aEVVbqttJrU+VxcOGm0o\niDlTOu5X+TaHZaWqJtSZ+CbEHWgDbllIcUJPWXiQvQJvuxpXBzCP5G5RPbrH\nVDI/2r04RM0XLTOopDcVbwQydpyFhfa/JQPI28jJEhRqstjMMDmVssLQRZoq\nQn2Cf6/+KkYFPpxg2IayTx9oK2WXWuxp+XBn7ETMqWpV3InStUuSy0Jn9ltC\n/Q5f\r\n=eiyK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCN9sPQgaVd5UVAdqjz7MasTXH7UtwkgCh5Tep6UUm2hQIgKmNYmlZQBfz4pSnQl5jlaMSF8Jat1pNtPuP6MHyeurE="}]},"_npmUser":{"name":"alehuo","email":"alehuo@pm.me"},"directories":{},"maintainers":[{"name":"alehuo","email":"alehuo@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-ratio_1.0.0_1604474267711_0.6958344695785899"},"_hasShrinkwrap":false},"1.0.1":{"name":"@alehuo/coffee-ratio","version":"1.0.1","description":"Coffee ratio calculator","main":"dist/src/index.js","typings":"dist/src/index.d.ts","private":false,"scripts":{"test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"keywords":["coffee","calculator"],"repository":{"type":"git","url":"git+https://github.com/alehuo/coffee-ratio.git"},"author":{"name":"Aleksi Huotala","email":"alehuo@pm.me"},"license":"MIT","devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@babel/preset-typescript":"^7.12.1","@types/jest":"^26.0.15","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0","babel-jest":"^26.6.1","eslint":"^7.12.1","eslint-config-standard":"^16.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.2.1","jest":"^26.6.1","typescript":"^4.0.5"},"gitHead":"e012c646a95e69b846b87580ad3d95a460e91ab6","bugs":{"url":"https://github.com/alehuo/coffee-ratio/issues"},"homepage":"https://github.com/alehuo/coffee-ratio#readme","_id":"@alehuo/coffee-ratio@1.0.1","_nodeVersion":"10.16.2","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kRVCL+5E66UvA/SrCseafIyct3u+nmCzPad+YJ0lH/rSRDRUNwOdy84xVJXFDvEUyntIyC6PcQYqhHx5dHrnBg==","shasum":"17590831cea06c2de09c80c2015d8a292b000acc","tarball":"https://registry.npmjs.org/@alehuo/coffee-ratio/-/coffee-ratio-1.0.1.tgz","fileCount":5,"unpackedSize":14902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfolgHCRA9TVsSAnZWagAA6T0P/jDCpoBuLMWsrF66EgDw\nlz+JQpVCWBBlYklCZqPjpSykuKE+zl1z4GTxI7w7fzaTFV7UNfADJqNcf1Gh\nhsj9XqvLYldUtldr5a5xndJyOIq4eVd7nVo9KlWWjUuWEvj/nh29vUorotCL\n3/H9AYsBwQ5bJ1eZ8EbSu3LTpE4HpkGv8iSWNXomVx2n1JgwH6AJRLWRI6ys\nN2/j8JR8mqZMUIUA7vJxy4O89sANdyEYEeUO0p4PNXY+Cng248w0F2X6TmK1\nlc8dIL3ze+naUZBGN1IJepDGKRMKY1/pdTin7bbkFDNXDsf90OuvkaPmMgKi\nAaHFuQq7uUfGaEF+j3e6+4bYSO4NQzeJ2RZtaTDSb5GjyGQYKqepIW7MGy0y\n6COZPlvDsRm2R4/70EouR9kCqS36rMdgViWid25yd1IrZpj69A//mkcaZk4S\noWMbI0yy4ajNnZUAMqsd3IPHdpa+QYFtfaMYsNudc4kcL3LqiVOhPAwlIyri\nY/zbDTw+qzU5lJFNe87M/bCw+6oo7MEw9Od7Bx46HVmKJJ8SSwMlAQV/EyxE\nZLzgDhqIeer+hTo4pzXCVOgOqBMLXCqhp0uGFeIzVSCqxVtd0GMFex6UiAbb\nCu/b1JOPqxo+uTiKyhB7jg4IXYtVpB2F3QobV6bYzdk4DqF9TS2smKvQFNPL\nqq7q\r\n=818Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID8j3K8cvc8Lo6WOE9/qwjkLcJ0NX1YScnz1+MWeBc+oAiEA8ViIYyTKh9TIvFBhOBFb5ckpvWqldWUwbGMpdUub7B8="}]},"_npmUser":{"name":"alehuo","email":"alehuo@pm.me"},"directories":{},"maintainers":[{"name":"alehuo","email":"alehuo@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-ratio_1.0.1_1604474886685_0.027756488795498857"},"_hasShrinkwrap":false},"1.0.2":{"name":"@alehuo/coffee-ratio","version":"1.0.2","description":"Coffee ratio calculator","main":"dist/src/index.js","typings":"dist/src/index.d.ts","private":false,"scripts":{"test":"jest","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"keywords":["coffee","calculator"],"repository":{"type":"git","url":"git+https://github.com/alehuo/coffee-ratio.git"},"author":{"name":"Aleksi Huotala","email":"alehuo@pm.me"},"license":"MIT","devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","@babel/preset-typescript":"^7.12.1","@types/jest":"^26.0.15","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0","babel-jest":"^26.6.1","eslint":"^7.12.1","eslint-config-standard":"^16.0.1","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.2.1","jest":"^26.6.1","typescript":"^4.0.5"},"gitHead":"7e5c55c6826ac6246cd031a14e797bee2d204e77","bugs":{"url":"https://github.com/alehuo/coffee-ratio/issues"},"homepage":"https://github.com/alehuo/coffee-ratio#readme","_id":"@alehuo/coffee-ratio@1.0.2","_nodeVersion":"10.16.2","_npmVersion":"6.14.8","dist":{"integrity":"sha512-y0eAHNWy24Z4hfz2XaJ+LvnlZhDEFb1sWP6aH1sdqk3arWmwhFpXL16XcYUEe9EXTJe05yDvTPUMuJFr6XyJuQ==","shasum":"b67bd8d98f2080f7fef28008b97a9ca8a0a4ea16","tarball":"https://registry.npmjs.org/@alehuo/coffee-ratio/-/coffee-ratio-1.0.2.tgz","fileCount":6,"unpackedSize":16120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfolrVCRA9TVsSAnZWagAACLIP/RJ6w1ui1kwby8RRbdFU\nocaRH4uyuhMFXp/ELnjKxy2V89auPeNnOhO02oTDgdhZFDJns+Hpne0UMrDI\nacwCo859+8tQI2v3e/jTlJyfUFGICS+U03YV+Tj0A6FBX8+emEP8YcU0mFwJ\na5Zn+woRci/pV/cGkGLzTAuL4SuZF+0t/jac+zlw4sz7UdsXiGJYhUWaBvGT\nRG2Fbfn2diQIw+7OwZilSQung1JwfXZzY4yMapaRK4BvzMKUpwkX5F4R+0DU\nyBYu6sD8UENkW9T9GErDncupVVVcSwJhglSNdgzw2MazZajREe1AV2c0aZGv\nsCKFNcbG5Z8PCDcHoWQfwMCFEm1/0/UaIMu95nxFNk5pAGcbTwoI3X21MbBg\n+n/sXpdzZdnF4sniiyye8GFlz13hFctcsL/K04T4LgvaBb+uvq7lx9Ouw6eF\na9ToCyekeVzPEcLQCeWyZx3kOrXTvj8TtDW3FBLNdnS4cmSmM3r5rlQk7MBP\nRIu1rlrqzr9QIxmUELBX7diEkOfl8RHxzvjFyoVRgPhvg5qm0Y18IuOtrtti\n0kjjvZ2lgNWwysn0XbSXIZpyMdfhRKzvPUFhtc2sp4VE7MfDvqtzdeZcEu9c\n9HksSqabUbVFOHnQ7ZJTboY0QbkY2Ad6es07eWkgeJfTCdJD37QNRld4K4Cm\n74+t\r\n=CxPX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwLq/y+o6TUPSK1Ovsq8ViE4/otA6EsIYe+dYu3pbvDQIhAIVmcR+Mz93tLvTaQun1VVQbVy4WTz7Mih4XFKr7XBnX"}]},"_npmUser":{"name":"alehuo","email":"alehuo@pm.me"},"directories":{},"maintainers":[{"name":"alehuo","email":"alehuo@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coffee-ratio_1.0.2_1604475605274_0.715867451595037"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-04T07:17:47.663Z","1.0.0":"2020-11-04T07:17:47.854Z","modified":"2022-04-04T12:37:05.463Z","1.0.1":"2020-11-04T07:28:06.784Z","1.0.2":"2020-11-04T07:40:05.396Z"},"maintainers":[{"name":"alehuo","email":"alehuo@pm.me"}],"description":"Coffee ratio calculator","keywords":["coffee","calculator"],"author":{"name":"Aleksi Huotala","email":"alehuo@pm.me"},"license":"MIT","readme":"# coffee-ratio\n\n[![npm version](https://badge.fury.io/js/%40alehuo%2Fcoffee-ratio.svg)](https://badge.fury.io/js/%40alehuo%2Fcoffee-ratio)\n\n## Introduction\n\n`coffee-ratio` is a zero-dependency, must-have tool for all coffee artisans. With `coffee-ratio`, you can calculate coffee ratios for the perfect brew. Measuring how much water & coffee beans you need is also made possible with this library.\n\n## Installation\n\n`npm install --save @alehuo/coffee-ratio`\n\nTypeScript typings are included out of the box.\n\n## Usage\n\n**Case 1:** What is the coffee ratio with 40 grams of coffee beans and 200 grams of water?\n\n```typescript\nimport { Water, Coffee, Ratio, isLeft } from \"@alehuo/coffee-ratio\";\nconst ratioResult = Ratio.calculate(Coffee.fromGrams(40), Water.fromGrams(200));\nif (isLeft(ratioResult)) {\n  console.log(ratioResult.result);\n  /*\n    {\n        \"ratio\": 0.2,\n        \"ratioParts\": {\n            \"firstPart\": 1,\n            \"secondPart\": 5\n        },\n        \"total\": [Function: total]\n    }\n    */\n}\n```\n\nYou can use the `total` function to calculate required ingredients for any amount of cups you want to brew:\n\n```typescript\n// Using ratioResult from the earlier piece of code\nconst totalResult = ratioResult.result.total(10);\nif (isLeft(ratioResult)) {\n  console.log(ratioResult.result);\n  /*\n    {\n        water: {\n            value: 2000,\n            type: \"millilitre\"\n        },\n        coffee: {\n            value: 4000;\n            type: \"gram\";\n        }\n    }\n    */\n}\n```\n\n**Case 2:** I want to brew coffee with 1:9 ratio. How much water do I need when I have 45 grams of coffee beans?\n\n```typescript\nimport { Water, Coffee, isLeft } from \"@alehuo/coffee-ratio\";\nconst waterAmount = Water.fromRatioAndCoffeeAmount(1 / 9, Coffee.fromGrams(45));\nif (isLeft(waterAmount)) {\n  console.log(waterAmount.result);\n  /*\n    {\n        \"value\": 414,\n        \"type\": \"millilitre\"\n    }\n    */\n}\n```\n\n## License\n\nMIT license.","readmeFilename":"README.md","homepage":"https://github.com/alehuo/coffee-ratio#readme","repository":{"type":"git","url":"git+https://github.com/alehuo/coffee-ratio.git"},"bugs":{"url":"https://github.com/alehuo/coffee-ratio/issues"}}