{"id":16666389,"url":"https://github.com/mitjap/food-reverse-engineer","last_synced_at":"2026-04-20T23:33:15.144Z","repository":{"id":146800980,"uuid":"28716878","full_name":"mitjap/food-reverse-engineer","owner":"mitjap","description":"library for reverse engineering ingredients' proportions in a food based on it's nutrition data","archived":false,"fork":false,"pushed_at":"2015-01-02T15:24:44.000Z","size":136,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T14:44:18.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitjap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-02T15:18:48.000Z","updated_at":"2022-12-30T06:16:37.000Z","dependencies_parsed_at":"2023-03-26T13:32:14.885Z","dependency_job_id":null,"html_url":"https://github.com/mitjap/food-reverse-engineer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitjap/food-reverse-engineer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitjap%2Ffood-reverse-engineer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitjap%2Ffood-reverse-engineer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitjap%2Ffood-reverse-engineer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitjap%2Ffood-reverse-engineer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitjap","download_url":"https://codeload.github.com/mitjap/food-reverse-engineer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitjap%2Ffood-reverse-engineer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32070656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T11:10:49.290Z","updated_at":"2026-04-20T23:33:15.124Z","avatar_url":"https://github.com/mitjap.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Usage:\nvar fre = require('food-reverse-engieer');\nfre.run(input, options, function(error, result) { /\\* do something \\*/ });\n\n_Note: Algorithm is run asynchronously._\n\nExample _result_ object:\n```\n{ \n  input: { /* input object */ },\n   amount: [\n    { name: 'sesame', amount: 0.058210649595114974 },\n    { name: 'flex seeds', amount: 0.11450554722488634 },\n    { name: 'raisins', amount: 0.13232693840615012 },\n    { name: 'almonds', amount: 0.13740219462342493 },\n    { name: 'date paste', amount: 0.15239908063363478 },\n    { name: 'agave sirup', amount: 0.17971114071786315 },\n    { name: 'brown rice protein', amount: 0.22544444879892583 }\n  ],\n  total: { /* new nutrition data */\n    energy: 1635.6887218153524,\n    protein: 27.736885010506708,\n    carbohydrate: 43.46070512777145,\n    sugar: 29.82414576205363,\n    fiber: 7.465429650308641,\n    fat: 14.105646907164719,\n    saturates: 1.4472382243023976,\n    sodium: 5.244270938513696\n  },\n  diff: { \n    energy: -162.31127818464756,\n    protein: -2.2631149894932925,\n    carbohydrate: -0.5392948722285524,\n    sugar: 3.8241457620536288,\n    fiber: -2.534570349691359,\n    fat: 2.1056469071647186,\n    saturates: -0.5527617756976024,\n    sodium: -12.755729061486303 \n  },\n  deviation: {\n    energy: -0.09027323592027114,\n    protein: -0.07543716631644304,\n    carbohydrate: -0.01225670164155801,\n    sugar: 0.14708252930975485,\n    fiber: -0.25345703496913585,\n    fat: 0.1754705755970598,\n    saturates: -0.2763808878488012,\n    sodium: -0.7086516145270169\n  }\n}\n```\n\nExample options object:\n```\nvar options = {\n  popSize: 200,\n  generations: 150,\n  mutateProbability: 0.3,\n  crossoverProbability: 04\n}\n```\n\nExample input object:\n```\nvar input = {\n  ingredients: [ {\n    name: \"sesame\",\n    //amount: 0.09,\n    nutrition: {\n      energy: 2366.0,\n      protein: 17.0,\n      carbohydrate: 25.7,\n      sugar: 0.0,\n      fiber: 14.0,\n      fat: 48.0,\n      saturates: 6.7,\n      sodium: 11.0\n    }\n  }, {\n    name: \"flex seeds\",\n    //amount: 0.12,\n    nutrition: {\n      energy: 2236.0,\n      protein: 18.3,\n      carbohydrate: 28.9,\n      sugar: 1.5,\n      fiber: 27.3,\n      fat: 42.2,\n      saturates: 4.7,\n      sodium: 30.0\n    }\n  }, {\n    name: \"raisins\",\n    nutrition: {\n    energy: 1252.0,\n    protein: 3.2,\n    carbohydrate: 79.2,\n    sugar: 59.2,\n    fiber: 3.7,\n    fat: 0.5,\n    saturates: 0.1,\n    sodium: 11.0\n    }\n  }, {\n    name: \"almonds\",\n    nutrition: {\n    energy: 2407.0,\n    protein: 21.2,\n    carbohydrate: 21.7,\n    sugar: 3.9,\n    fiber: 12.2,\n    fat: 49.4,\n    saturates: 3.7,\n    sodium: 1.0\n    }\n  }, {\n    name: \"date paste\",\n    nutrition: {\n    energy: 1160.0,\n    protein: 1.8,\n    carbohydrate: 75.0,\n    sugar: 66.5,\n    fiber: 6.7,\n    fat: 0.2,\n    sodium: 1.0\n    }\n  }, {\n    name: \"agave sirup\",\n    nutrition: {\n    energy: 1197.0,\n    protein: 0.0,\n    carbohydrate: 76.2,\n    sugar: 71.4,\n    fiber: 4.8\n    }\n  }, {\n    name: \"brown rice protein\",\n    nutrition: {\n    energy: 1570.0,\n    protein: 80.0,\n    carbohydrate: 10.0,\n    fat: 1.0\n    }\n  } ],\n\n  total: {\n    energy: 1798.0,\n    protein: 30.0,\n    carbohydrate: 44.0,\n    sugar: 26.0,\n    fiber: 10.0,\n    fat: 12.0,\n    saturates: 2.0,\n    sodium: 18.0\n  }\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitjap%2Ffood-reverse-engineer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitjap%2Ffood-reverse-engineer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitjap%2Ffood-reverse-engineer/lists"}