{"id":20645975,"url":"https://github.com/jakecyr/subtotal-object-array","last_synced_at":"2026-04-18T14:03:55.325Z","repository":{"id":114278074,"uuid":"140756986","full_name":"jakecyr/subtotal-object-array","owner":"jakecyr","description":"Subtotal JavaScript object array by change in column","archived":false,"fork":false,"pushed_at":"2020-01-28T03:09:30.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T09:17:47.778Z","etag":null,"topics":["algorithm","angularjs","javascript","sub-total"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakecyr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-12T19:36:32.000Z","updated_at":"2020-01-28T03:09:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ab1cd1a-4c3d-4b34-bc8f-0c6f5366860c","html_url":"https://github.com/jakecyr/subtotal-object-array","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jakecyr/subtotal-object-array","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fsubtotal-object-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fsubtotal-object-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fsubtotal-object-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fsubtotal-object-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakecyr","download_url":"https://codeload.github.com/jakecyr/subtotal-object-array/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fsubtotal-object-array/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31971493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["algorithm","angularjs","javascript","sub-total"],"created_at":"2024-11-16T16:22:52.812Z","updated_at":"2026-04-18T14:03:50.314Z","avatar_url":"https://github.com/jakecyr.png","language":"JavaScript","readme":"# Subtotal JavaScript Object Array\n\nSubtotal JavaScript object array by change in a specified key. Originally made for an AngularJS subtotals HTML table.\n\n### Example Usage\n\nThe following code:\n\n```javascript\nconst subtotal = require('../src/subtotal');\n\nconst masterData = [\n    {\n        name: 'Jake',\n        value_0: 1,\n        value_1: 2\n    }, {\n        name: 'John',\n        value_0: 4,\n        value_1: 2\n    }, {\n        name: 'John',\n        value_0: 4,\n        value_1: 1\n    }, {\n        name: 'Sally',\n        value_0: 8,\n        value_1: 2\n    }\n];\n\nlet output = subtotal(masterData, 'name', ['value_0', 'value_1']);\n```\n\nwill produce the following JavaScript object:\n\n```javascript\n{\n  \"John\":{\n    data: [{name: \"John\", value_0: 4, value_1: 2}, {name: \"John\", value_0: 4, value_1: 1}],\n    totals:{\n      value_0: 8,\n      value_1: 3\n    }\n  },\n  ...\n}\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakecyr%2Fsubtotal-object-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakecyr%2Fsubtotal-object-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakecyr%2Fsubtotal-object-array/lists"}