{"id":27401273,"url":"https://github.com/edjcase/motoko_glob","last_synced_at":"2026-01-23T14:45:40.484Z","repository":{"id":277412367,"uuid":"932249586","full_name":"edjCase/motoko_glob","owner":"edjCase","description":"A library for matching glob patterns","archived":false,"fork":false,"pushed_at":"2025-09-06T20:58:01.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-06T22:26:23.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Motoko","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/edjCase.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-13T16:02:02.000Z","updated_at":"2025-09-06T20:58:05.000Z","dependencies_parsed_at":"2025-02-13T20:25:41.932Z","dependency_job_id":"dd55719f-d5a4-4348-8df8-a17c750f704e","html_url":"https://github.com/edjCase/motoko_glob","commit_stats":null,"previous_names":["gekctek/motoko_glob"],"tags_count":0,"template":false,"template_full_name":"edjCase/motoko-library-template","purl":"pkg:github/edjCase/motoko_glob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edjCase%2Fmotoko_glob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edjCase%2Fmotoko_glob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edjCase%2Fmotoko_glob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edjCase%2Fmotoko_glob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edjCase","download_url":"https://codeload.github.com/edjCase/motoko_glob/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edjCase%2Fmotoko_glob/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-04-14T03:54:37.558Z","updated_at":"2026-01-23T14:45:40.462Z","avatar_url":"https://github.com/edjCase.png","language":"Motoko","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Glob: Path Pattern Matching for Motoko\n\nA glob pattern matching library for Motoko that supports a wide range of pattern matching features.\n\n## Installation\n\n```bash\nmops install glob\n```\n\nTo set up MOPS package manager, follow the instructions from the\n[MOPS Site](https://j4mwm-bqaaa-aaaam-qajbq-cai.ic0.app/)\n\n## Quick Start\n\n```motoko\nimport Glob \"mo:glob\";\n\n// Basic matching\nGlob.match(\"file.txt\", \"*.txt\"); // true\nGlob.match(\"dir/file.txt\", \"**/*.txt\"); // true\nGlob.match(\"script.js\", \"*.txt\"); // false\n\n// Directory matching\nGlob.match(\"/foo/bar/baz\", \"/foo/*/baz\"); // true\nGlob.match(\"/foo/bar/qux/baz\", \"/foo/**/baz\"); // true\n```\n\n## Features\n\n### Basic Wildcards\n\n- `*` matches any number of characters within a path segment\n- `?` matches exactly one character\n\n```motoko\nGlob.match(\"hello.txt\", \"h*.txt\"); // true\nGlob.match(\"hello.txt\", \"h????.txt\"); // true\n```\n\n### Directory Wildcards\n\n- `*/` matches a single directory level\n- `**/` matches zero or more directory levels\n\n```motoko\nGlob.match(\"/a/b/c\", \"/a/*/c\"); // true\nGlob.match(\"/a/b/c/d\", \"/a/**/d\"); // true\n```\n\n### Character Classes\n\n- `[abc]` matches any one character listed\n- `[a-z]` matches any one character in the range\n- `[!abc]` matches any one character not listed\n\n```motoko\nGlob.match(\"file1.txt\", \"file[1-3].txt\"); // true\nGlob.match(\"fileA.txt\", \"file[ABC].txt\"); // true\nGlob.match(\"fileD.txt\", \"file[!ABC].txt\"); // true\n```\n\n### Pattern Negation\n\n- `!pattern` matches paths that don't match the pattern\n\n```motoko\nGlob.match(\"/static/public/file.js\", \"!/static/private/**\"); // true\nGlob.match(\"/static/private/file.js\", \"!/static/private/**\"); // false\n```\n\n### Special Notes\n\n- Dot files (hidden files) are included in wildcard matches by default\n- Path separator normalization is handled automatically\n- Supports both absolute and relative paths\n- Escaping special characters with backslash\n\n## API Reference\n\n### `match(path : Text, pattern : Text) : Bool`\n\nMatches a path against a glob pattern and returns true if it matches.\n\nParameters:\n\n- `path`: The path to test\n- `pattern`: The glob pattern to match against\n\nReturns:\n\n- `Bool`: True if the path matches the pattern, false otherwise\n\n## Examples\n\n### File Extensions\n\n```motoko\n// Match specific file types\nGlob.match(\"/static/file.js\", \"/static/*.js\"); // true\nGlob.match(\"/static/file.min.js\", \"/static/*.js\"); // true\n```\n\n### Nested Directories\n\n```motoko\n// Match files in nested directories\nGlob.match(\"/static/css/file.css\", \"/static/**/*.css\"); // true\nGlob.match(\"/static/css/nested/file.css\", \"/static/**/*.css\"); // true\n```\n\n### Complex Patterns\n\n```motoko\n// Version directories with multiple extensions\nGlob.match(\"/static/v1.2.3/app.js\", \"/static/v[0-9]*\\\\.[0-9]*\\\\.[0-9]*/**/*.js\"); // true\n\n// Multiple file extensions\nGlob.match(\"/static/styles.min.css\", \"/static/**/*.min.{js,css}\"); // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedjcase%2Fmotoko_glob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedjcase%2Fmotoko_glob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedjcase%2Fmotoko_glob/lists"}