{"id":22202152,"url":"https://github.com/rumkin/batch-match","last_synced_at":"2025-10-18T20:02:39.864Z","repository":{"id":143851962,"uuid":"60628772","full_name":"rumkin/batch-match","owner":"rumkin","description":"File system glob-like router","archived":false,"fork":false,"pushed_at":"2016-06-08T07:47:24.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T21:46:13.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npmjs.org/package/batch-match","language":"JavaScript","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/rumkin.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}},"created_at":"2016-06-07T16:24:48.000Z","updated_at":"2016-06-08T07:48:12.000Z","dependencies_parsed_at":"2023-06-28T17:16:19.942Z","dependency_job_id":null,"html_url":"https://github.com/rumkin/batch-match","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"bcc2add364c8e47dc8595228c7822e1f58a43ecf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rumkin/batch-match","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fbatch-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fbatch-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fbatch-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fbatch-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rumkin","download_url":"https://codeload.github.com/rumkin/batch-match/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fbatch-match/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261756967,"owners_count":23205167,"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":[],"created_at":"2024-12-02T16:12:34.719Z","updated_at":"2025-10-18T20:02:34.826Z","avatar_url":"https://github.com/rumkin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Batch Match\n\nIs a file pattern matcher like glob built for routing. It returns path and\nwildcard values separately.\n\n##\n\nInstall\n```\nnpm i batch-match\n```\n\n## Example\n\nFor example we want to select each file which ends with `-service.js` and use everything before prefix as name (eg. search, file and task).\n\nExample directory:\n```\n.\n|-- search-service.js\n|-- file-service.js\n`-- task-service.js\n```\n\nCode to find files with routes:\n\n```javascript\nconst bm = require('batch-match');\n\nbm.search('./*-service.js')\n.then(files =\u003e {\n    console.log(files); // -\u003e [['search-service.js', 'search'], ['file-service.js', 'file'], ...]\n});\n```\n\n## Cli util\n\nThere is cli util to find matches and output it to stdio in row mode:\n\n```shell\nbatch-match '*-service.js'\n```\n\nWill output:\n```\nsearch-service.js search\nfile-service.js file\ntask-service.js task\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fbatch-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frumkin%2Fbatch-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fbatch-match/lists"}