{"id":25386335,"url":"https://github.com/howiefh/ant-path-matcher","last_synced_at":"2025-10-30T14:31:20.373Z","repository":{"id":47289015,"uuid":"379769576","full_name":"howiefh/ant-path-matcher","owner":"howiefh","description":"ant path matcher","archived":false,"fork":false,"pushed_at":"2021-09-04T13:43:15.000Z","size":224,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T23:18:00.092Z","etag":null,"topics":["ant","matcher","path"],"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/howiefh.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":"2021-06-24T01:20:44.000Z","updated_at":"2024-09-27T01:33:22.000Z","dependencies_parsed_at":"2022-09-26T18:21:21.986Z","dependency_job_id":null,"html_url":"https://github.com/howiefh/ant-path-matcher","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howiefh%2Fant-path-matcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howiefh%2Fant-path-matcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howiefh%2Fant-path-matcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/howiefh%2Fant-path-matcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/howiefh","download_url":"https://codeload.github.com/howiefh/ant-path-matcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238981118,"owners_count":19562694,"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":["ant","matcher","path"],"created_at":"2025-02-15T10:33:47.714Z","updated_at":"2025-10-30T14:31:19.981Z","avatar_url":"https://github.com/howiefh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Node.js CI](https://github.com/howiefh/ant-path-matcher/actions/workflows/node.js.yml/badge.svg)\n\nAn implementation for Ant-style path patterns.\n\nPart of this mapping code has been kindly borrowed from [Apache Ant](https://ant.apache.org/) and [Spring Framework AntPathMatcher](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html).\n\nThe mapping matches URLs using the following rules:\n\n- `?` matches one character\n- `*` matches zero or more characters\n- `**` matches zero or more directories in a path\n- `{spring:[a-z]+}` matches the regexp `[a-z]+` as a path variable named \"spring\"\n\nExamples\n\n- `com/t?st.jsp` — matches com/test.jsp but also com/tast.jsp or com/txst.jsp\n- `com/*.jsp` — matches all .jsp files in the com directory\n- `com/**/test.jsp` — matches all test.jsp files underneath the com path\n- `org/springframework/**/*.jsp` — matches all .jsp files underneath the org/springframework path\n- `org/**/servlet/bla.jsp` — matches org/springframework/servlet/bla.jsp but also org/springframework/testing/servlet/bla.jsp and org/servlet/bla.jsp\n- `com/{filename:\\\\w+}.jsp` will match com/test.jsp and assign the value test to the filename variable\n\nNote: a pattern and a path must both be absolute or must both be relative in order for the two to match. Therefore it is recommended that users of this implementation to sanitize patterns in order to prefix them with \"/\" as it makes sense in the context in which they're used.\n\n## Install\n\n```\nnpm install @howiefh/ant-path-matcher --save\n```\n\n## Usage\n\n```\nimport AntPathMatcher from '@howiefh/ant-path-matcher';\n\nvar pathMatcher = new AntPathMatcher();\n\npathMatcher.match(\"/?\", \"/a\");\npathMatcher.match(\"test/*\", \"test/t\");\npathMatcher.match(\"/**\", \"/testing/testing\");\npathMatcher.match(\"/{bla}.*\", \"/testing.html\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowiefh%2Fant-path-matcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhowiefh%2Fant-path-matcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhowiefh%2Fant-path-matcher/lists"}