{"id":15967295,"url":"https://github.com/joscha/shardymcshardface","last_synced_at":"2025-07-19T12:32:48.167Z","repository":{"id":35066507,"uuid":"201961451","full_name":"joscha/ShardyMcShardFace","owner":"joscha","description":"Sharding things for CI systems","archived":false,"fork":false,"pushed_at":"2024-08-08T12:55:23.000Z","size":632,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T15:24:26.598Z","etag":null,"topics":["ci","continuous-integration","parallelization","sharding","test","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/joscha.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,"zenodo":null}},"created_at":"2019-08-12T15:49:42.000Z","updated_at":"2024-08-08T12:55:27.000Z","dependencies_parsed_at":"2025-04-30T15:24:25.171Z","dependency_job_id":"95933f2c-5b03-4c7c-a19f-0811113ff126","html_url":"https://github.com/joscha/ShardyMcShardFace","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/joscha/ShardyMcShardFace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joscha%2FShardyMcShardFace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joscha%2FShardyMcShardFace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joscha%2FShardyMcShardFace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joscha%2FShardyMcShardFace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joscha","download_url":"https://codeload.github.com/joscha/ShardyMcShardFace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joscha%2FShardyMcShardFace/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265934187,"owners_count":23852086,"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":["ci","continuous-integration","parallelization","sharding","test","testing"],"created_at":"2024-10-07T18:22:20.036Z","updated_at":"2025-07-19T12:32:48.151Z","avatar_url":"https://github.com/joscha.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShardyMcShardFace\n\nPackage to shard a set of items based on CI parallelization parameters, e.g. `YOUR_CI_SYSTEM_INDEX` and `YOUR_CI_SYSTEM_COUNT`.\n\n## Features:\n\n-   Shards as evenly as possible, uneven splits will end up in the tail shards\n-   Supports sharding less items than parallelization count; tail shards will be empty\n-   Distributes items into shards based on a given seed for a random number generator to provide random, but stable distribution.\n-   Fully typed in Typescript\n\n## Installation\n\n```bash\nyarn add shardy-mc-shard-face\n```\n\n## Usage\n\n```\nshardyMcShardFace(items: any[] [, options: { throwOnEmpty: boolean, throwWhenNotSharding: boolean, seed: string }]): shard[];\n```\n\nYou can get debug output by setting the environment variable `DEBUG=ShardyMcShardFace:*`.\n\n## Example\n\n```ts\nimport { shard as shardyMcShardFace } from 'shardy-mc-shard-face';\nconst shard = shardyMcShardFace([1, 2, 3, 4]);\n// shard is an array that contains items based on YOUR_CI_SYSTEM_INDEX and YOUR_CI_SYSTEM_COUNT\n```\n\n## CLI example\n\n```bash\ncat items | shardy shard\n```\n\nInput is expected to be newline-separated to `stdin`. Output is also newline-separated to `stdout`.\n\nOn a CI run this would look like this:\n\n```bash\n# CI_NODE_INDEX=1 (set by your CI system)\n# CI_NODE_TOTAL=2 (set by your CI system)\necho \"A\\nB\" | shardy shard\n# Will print \"A\" (w/o quotes) to stdout\n```\n\nyou can control the seed as well via `-s \u003cseed\u003e`.\nFor a full list of options, please run `shardy --help`.\n\n## CI system support\n\nCI systems supported are the ones supported by [ci-parallel-vars](https://github.com/jamiebuilds/ci-parallel-vars#supports). Feel free to open a pull request there and I will be happy to bump the dependency.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoscha%2Fshardymcshardface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoscha%2Fshardymcshardface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoscha%2Fshardymcshardface/lists"}