{"id":17445987,"url":"https://github.com/jamen/combin","last_synced_at":"2025-04-02T11:22:35.408Z","repository":{"id":57203815,"uuid":"80811112","full_name":"jamen/combin","owner":"jamen","description":"Create an array of string combinations","archived":false,"fork":false,"pushed_at":"2017-02-03T08:47:37.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-26T14:45:47.923Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jamen.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":"2017-02-03T08:30:20.000Z","updated_at":"2021-12-19T15:40:13.000Z","dependencies_parsed_at":"2022-09-17T15:03:01.895Z","dependency_job_id":null,"html_url":"https://github.com/jamen/combin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcombin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcombin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcombin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcombin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/combin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246803096,"owners_count":20836491,"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":[],"created_at":"2024-10-17T18:19:44.794Z","updated_at":"2025-04-02T11:22:35.390Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":["https://www.paypal.me/jamenmarz/5usd"],"categories":[],"sub_categories":[],"readme":"\n# combin\n\n\u003e Create an array of string combinations\n\nCreate string [combinations](https://en.wikipedia.org/wiki/Combination).  Optionally given a set of characters and rule.  It is useful for creating fake data or finding package names\n\n```js\nvar combin = require('combin')\n\n// All 3 letter combinations with vowel in center:\ncombin(3, function (item) {\n  return 'aeiou'.indexOf(item[1]) !== -1\n})\n```\n\n## Installation\n\n```sh\n$ npm install --save combin\n```\n\n## Usage\n\n### `combin(length, [set, rule])`\n\nCreate a an array of string [combinations](https://en.wikipedia.org/wiki/Combination), from the characters in `set`, and filtered by a `rule` function\n\n - `length` (`Number`): The length of each item. e.g., `2` would produce `['aa', 'ab', ...]`\n - `set` (`String`): A set of characters that make up the combinations\n - `rule` (`Function`): A function that filters the combinations\n\n```js\ncombin(3)\n// [ 'aaa', 'aab', 'aac', ..., 'zzx', 'zzy', 'zzz' ]\n\ncombin(2, '01')\n// [ '00', '01', '10', '11' ]\n\ncombin(2, 'abc', x =\u003e x[0] !== 'a')\n// [ 'ba', 'bb', 'bc', 'ca', 'cb', 'cc' ]\n```\n\n## License\n\nMIT © [Jamen Marz](https://git.io/jamen)\n\n---\n\n[![version](https://img.shields.io/npm/v/combin.svg?style=flat-square)][package] [![travis](https://img.shields.io/travis/combin/jamen.svg?style=flat-square)](https://travis-ci.org/combin/jamen) [![downloads/month](https://img.shields.io/npm/dm/combin.svg?style=flat-square)][package] [![downloads](https://img.shields.io/npm/dt/combin.svg?style=flat-square)][package] [![license](https://img.shields.io/npm/l/combin.svg?style=flat-square)][package] [![support me](https://img.shields.io/badge/support%20me-paypal-green.svg?style=flat-square)](https://www.paypal.me/jamenmarz/5usd) [![follow](https://img.shields.io/github/followers/jamen.svg?style=social\u0026label=Follow)](https://github.com/jamen)\n[package]: https://npmjs.com/package/combin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fcombin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Fcombin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fcombin/lists"}