{"id":19190049,"url":"https://github.com/apainintheneck/globlin","last_synced_at":"2025-10-16T18:07:06.590Z","repository":{"id":253358298,"uuid":"843265609","full_name":"apainintheneck/globlin","owner":"apainintheneck","description":"File globbing for Gleam","archived":false,"fork":false,"pushed_at":"2024-12-02T04:34:35.000Z","size":49,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T06:09:16.146Z","etag":null,"topics":["fnmatch","gleam","glob"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/globlin","language":"Gleam","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/apainintheneck.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2024-08-16T06:15:56.000Z","updated_at":"2025-01-09T19:54:11.000Z","dependencies_parsed_at":"2024-08-22T02:32:48.991Z","dependency_job_id":null,"html_url":"https://github.com/apainintheneck/globlin","commit_stats":null,"previous_names":["apainintheneck/path_pattern","apainintheneck/globlin"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apainintheneck%2Fgloblin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apainintheneck%2Fgloblin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apainintheneck%2Fgloblin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apainintheneck%2Fgloblin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apainintheneck","download_url":"https://codeload.github.com/apainintheneck/globlin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240266856,"owners_count":19774075,"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":["fnmatch","gleam","glob"],"created_at":"2024-11-09T11:32:48.044Z","updated_at":"2025-10-16T18:07:01.535Z","avatar_url":"https://github.com/apainintheneck.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# globlin\n\n[![Package Version](https://img.shields.io/hexpm/v/globlin)](https://hex.pm/packages/globlin)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/globlin/)\n\nThis package brings file globbing to Gleam. A `Pattern` is created by compiling the glob pattern string into the equivalent regex internally. This pattern can then be compared against other strings to find matching paths.\n\nNote: This library doesn't include methods to directly query the file system so that it can be used in the browser where that isn't available. If you're looking for file system globbing, check out the [globlin_fs](https://hexdocs.pm/globlin_fs/index.html) package.\n\nNote 2: This library only currently supports Unix file paths. That means it should work on Linux, macOS and BSD.\n\n## Add Dependency\n\n```sh\ngleam add globlin\n```\n\n## Pattern Syntax\n\nThere are seven special matching patterns supported by this package. They should be familiar to anyone who has used similar packages before.\n\n### Question Mark `?`\n\nThis matches any single character except the slash `/`.\n\n### Star `*`\n\nThis matches zero or more characters except the slash `/`.\n\n### Globstar `**`\n\nThis matches zero or more directories. It must be surrounded by the end of the string or slash `/`.\n\nExamples:\n- Isolated: `**`\n- Prefix: `**/tail`\n- Infix: `head/**/tail`\n- Postfix: `head/**`\n\nNote: When found at the end of the pattern, it matches all directories and files.\n\n### Inclusive Char Set `[abc]`\n\nThis matches any character in the set.\n\n### Exclusive Char Set `[!abc]`\n\nThis matches any character not in the set when the exclamation point `!` follows the opening square bracket.\n\n### Inclusive Range `[a-z]`\n\nThis matches any character from start to finish.\n\n### Exclusive Range `[!a-z]`\n\nThis matches any character not included in a range.\n\n## Option Flags\n\nThere are two option flags available to change the behavior of matching. They are both turned off by default when using the `new_pattern` method.\n\n### `ignore_case`\n\nThis changes all matches to be case insensitive.\n\n### `match_dotfiles`\n\nAllow wildcards like `?`, `*` and `**` to match dotfiles.\n\n## Example\n\n```gleam\nimport gleam/io\nimport gleam/list\nimport globlin\n\npub fn main() {\n  let files = [\n    \".gitignore\", \"gleam.toml\", \"LICENCE\", \"manifest.toml\", \"README.md\",\n    \"src/globlin.gleam\", \"test/globlin_test.gleam\",\n  ]\n\n  let assert Ok(pattern) = globlin.new_pattern(\"**/*.gleam\")\n\n  files\n  |\u003e list.filter(keeping: globlin.match_pattern(pattern:, path: _))\n  |\u003e list.each(io.println)\n  // src/globlin.gleam\n  // test/globlin_test.gleam\n}\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/globlin\u003e.\n\n## Development\n\n```sh\ngleam test  # Run the tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapainintheneck%2Fgloblin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapainintheneck%2Fgloblin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapainintheneck%2Fgloblin/lists"}