{"id":51133678,"url":"https://github.com/trananhtung/brace-expansion","last_synced_at":"2026-06-25T15:01:46.270Z","repository":{"id":366610676,"uuid":"1276659330","full_name":"trananhtung/brace-expansion","owner":"trananhtung","description":"Bash-style brace expansion: a{b,c}d -\u003e [abd, acd], {1..3} -\u003e [1,2,3]. A faithful Rust port of the brace-expansion npm package. Zero deps, no_std.","archived":false,"fork":false,"pushed_at":"2026-06-22T14:45:05.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-22T16:16:38.187Z","etag":null,"topics":["bash","brace-expansion","glob","no-std","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trananhtung.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-22T07:16:59.000Z","updated_at":"2026-06-22T14:47:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/trananhtung/brace-expansion","commit_stats":null,"previous_names":["trananhtung/brace-expansion"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/trananhtung/brace-expansion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fbrace-expansion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fbrace-expansion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fbrace-expansion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fbrace-expansion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trananhtung","download_url":"https://codeload.github.com/trananhtung/brace-expansion/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fbrace-expansion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34780126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"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":["bash","brace-expansion","glob","no-std","rust"],"created_at":"2026-06-25T15:01:45.490Z","updated_at":"2026-06-25T15:01:46.256Z","avatar_url":"https://github.com/trananhtung.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# brace-expansion\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n[![Crates.io](https://img.shields.io/crates/v/brace-expansion.svg)](https://crates.io/crates/brace-expansion)\n[![Documentation](https://docs.rs/brace-expansion/badge.svg)](https://docs.rs/brace-expansion)\n[![CI](https://github.com/trananhtung/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/trananhtung/brace-expansion/actions/workflows/ci.yml)\n[![License](https://img.shields.io/crates/l/brace-expansion.svg)](#license)\n\n**Bash-style brace expansion** — `a{b,c}d` → `[\"abd\", \"acd\"]`, `{1..3}` →\n`[\"1\", \"2\", \"3\"]`. A faithful Rust port of the\n[`brace-expansion`](https://www.npmjs.com/package/brace-expansion) npm package (the\nexpander behind `minimatch`/`glob`), which implements `bash`'s rules. Zero\ndependencies and `#![no_std]`.\n\n```rust\nuse brace_expansion::expand;\n\nassert_eq!(expand(\"a{b,c}d\"), [\"abd\", \"acd\"]);\nassert_eq!(expand(\"{1..3}\"), [\"1\", \"2\", \"3\"]);\nassert_eq!(expand(\"{a..c}\"), [\"a\", \"b\", \"c\"]);\nassert_eq!(expand(\"{01..03}\"), [\"01\", \"02\", \"03\"]);   // zero-padded\nassert_eq!(expand(\"{1..10..2}\"), [\"1\", \"3\", \"5\", \"7\", \"9\"]); // step\nassert_eq!(expand(\"a{b,c{d,e}}f\"), [\"abf\", \"acdf\", \"acef\"]); // nested\n```\n\n## Why brace-expansion?\n\nBrace expansion is the first thing a shell does to a glob, and the JS module that\nimplements it is one of the most-depended-on packages in existence. Its rules are\ndeceptively subtle — numeric and alphabetic sequences, optional steps and\nzero-padding, nested sets, backslash escaping, and a handful of bash compatibility\nquirks. This is that algorithm, ported faithfully: output is identical to the npm\npackage (verified over thousands of patterns), which in turn matches `bash` for\nordinary patterns.\n\n```toml\n[dependencies]\nbrace-expansion = \"0.1\"\n```\n\n## API\n\n| Item | Purpose |\n| --- | --- |\n| `expand(pattern)` | Expand a pattern into a `Vec\u003cString\u003e` |\n| `expand_with_max(pattern, max)` | Same, with a custom result cap |\n| `EXPANSION_MAX` | The default cap (`100_000`) |\n\n## Behavior\n\n- Comma sets (`{a,b,c}`) expand to each member; sets combine as a cross product.\n- `{x..y}` is a sequence: numeric (`{1..5}`, `{-3..3}`) or alphabetic (`{a..e}`),\n  with an optional step (`{0..10..2}`) and zero-padding (`{01..05}`).\n- Sets and sequences nest arbitrarily.\n- `\\{`, `\\}`, `\\,`, `\\.`, and `\\\\` are escaped and emitted literally.\n- Patterns with no valid expansion (`foo`, `{a}`, `a{}b`) are returned unchanged,\n  including bash's leading-`{}` quirk.\n\nOutput is identical to the npm package for ordinary patterns (verified over many\nthousands of cases). A few deliberate edge differences: sequence endpoints use exact\n`i64` arithmetic rather than JavaScript's lossy `f64` (so they stay exact past 2^53),\nnesting beyond a few hundred levels degrades gracefully instead of recursing without\nbound, and the literal NUL-delimited markers used internally are not expected in\nreal patterns.\n\n## Contributors ✨\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the [emoji key](https://allcontributors.org/docs/en/emoji-key) for how each contribution is recognized, and open a PR or issue to get involved.\n\nThanks goes to these wonderful people:\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/trananhtung\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/30992229?v=4?s=100\" width=\"100px;\" alt=\"Tung Tran\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTung Tran\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/trananhtung/brace-expansion/commits?author=trananhtung\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-trananhtung\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nLicensed under either of [Apache-2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT) at\nyour option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrananhtung%2Fbrace-expansion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrananhtung%2Fbrace-expansion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrananhtung%2Fbrace-expansion/lists"}