The request
Node.js recipe scaling and shopping list tool
Read the full request
Build a self-contained Node.js command-line application for scaling recipes and consolidating a shopping list. Use one documented JSON input file containing recipes with id, name, original servings, and ingredients (name, numeric quantity, unit), plus a plan listing each selected recipe id and desired servings. The CLI reads that file, scales quantities by desired/original servings, combines entries only when normalized ingredient name and unit match, sorts output deterministically, and prints a JSON shopping list. Refuse malformed JSON, unknown recipe ids, non-positive servings or quantities, and unsupported units with actionable errors. Include a small example input, README usage, and automated tests for scaling, consolidation, unit separation, and invalid inputs. Use only local files and no external service or API. Do not modify mgtf/atoma.
The journey
- Read the requestTurned it into a list of things it would have to prove before calling the work done.
- Did the workPlanned the pieces, built them and checked the result as it went.
- Delivered5 files handed over.
The result
- example.json647 B
- index.js4.2 KB
- package.json244 B
- README.md1.2 KB
- test.js2.1 KB