{"id":21451846,"url":"https://github.com/reity/summations-js","last_synced_at":"2025-03-17T02:42:45.349Z","repository":{"id":57374406,"uuid":"226012988","full_name":"reity/summations-js","owner":"reity","description":"Library to enumerate all natural number lists with a target sum.","archived":false,"fork":false,"pushed_at":"2019-12-06T04:59:34.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-23T00:22:51.947Z","etag":null,"topics":["combinations","combinatorics","enumeration","exhaustive-search","javascript-lib","javascript-library","mathematics"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/summations","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reity.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":"2019-12-05T04:03:34.000Z","updated_at":"2019-12-06T04:59:36.000Z","dependencies_parsed_at":"2022-08-29T18:32:01.780Z","dependency_job_id":null,"html_url":"https://github.com/reity/summations-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fsummations-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fsummations-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fsummations-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reity%2Fsummations-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reity","download_url":"https://codeload.github.com/reity/summations-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243964628,"owners_count":20375807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["combinations","combinatorics","enumeration","exhaustive-search","javascript-lib","javascript-library","mathematics"],"created_at":"2024-11-23T04:26:22.801Z","updated_at":"2025-03-17T02:42:45.332Z","avatar_url":"https://github.com/reity.png","language":"JavaScript","readme":"# summations-js\nLibrary to enumerate all natural number lists with a target sum.\n\n[![npm version](https://badge.fury.io/js/summations.svg)](https://badge.fury.io/js/summations)\n\n## Package Installation and Usage\n\nThe package is available on npm:\n```shell\nnpm install summations\n```\nThe library can be imported in the usual ways:\n```javascript\nvar summations = require('summations');\n```\nThe library also supports standalone usage in browsers:\n```html\n\u003cscript src=\"https://reity.org/summations-js/lib/summations.js\"\u003e\u003c/script\u003e\n```\n\n## Examples\n\nIt is possible to enumerate all possible lists of natural numbers of a given length that add up to a target sum.\n```javascript\nvar results = summations.sumLen(2, 3);\n```\nGiven the object above, we can query it for each value \n```javascript\n\u003e results\n[\n  [1, 1, 0],\n  [0, 1, 1],\n  [1, 0, 1],\n  [2, 0, 0],\n  [0, 2, 0],\n  [0, 0, 2],\n]\n```\n\n## Testing\n\nUnit tests are included in `test/test.js`. They can be run using [Mocha](https://mochajs.org/):\n```javascript\nnpm test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freity%2Fsummations-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freity%2Fsummations-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freity%2Fsummations-js/lists"}