{"id":21525278,"url":"https://github.com/superraytin/file-content-matcher","last_synced_at":"2026-02-24T19:34:44.012Z","repository":{"id":46725410,"uuid":"402349725","full_name":"superRaytin/file-content-matcher","owner":"superRaytin","description":"Search files recursively using content match.","archived":false,"fork":false,"pushed_at":"2024-08-07T11:32:37.000Z","size":262,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T08:17:45.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/superRaytin.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":"2021-09-02T08:40:44.000Z","updated_at":"2025-07-09T12:17:56.000Z","dependencies_parsed_at":"2024-10-01T20:00:43.674Z","dependency_job_id":"69e0f3c8-e10c-4980-a76d-d3f05edf5f83","html_url":"https://github.com/superRaytin/file-content-matcher","commit_stats":null,"previous_names":["superraytin/contentmatch"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/superRaytin/file-content-matcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superRaytin%2Ffile-content-matcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superRaytin%2Ffile-content-matcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superRaytin%2Ffile-content-matcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superRaytin%2Ffile-content-matcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superRaytin","download_url":"https://codeload.github.com/superRaytin/file-content-matcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superRaytin%2Ffile-content-matcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280856746,"owners_count":26403188,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"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":[],"created_at":"2024-11-24T01:34:15.633Z","updated_at":"2025-10-24T19:35:01.457Z","avatar_url":"https://github.com/superRaytin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# file-content-matcher\nSearch files recursively using content match.\n\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n\n[npm-url]: https://npmjs.org/package/file-content-matcher\n[downloads-image]: http://img.shields.io/npm/dm/file-content-matcher.svg\n[npm-image]: http://img.shields.io/npm/v/file-content-matcher.svg\n\n## Install\n\n```\nnpm i file-content-matcher\n```\n\n## Quick Start\n\n```js\nimport FileContentMatcher from 'file-content-matcher'\n\nconst matcher = new FileContentMatcher()\nmatcher.match(\n  {\n    path: 'path to search',\n    filter: {\n      namePatterns: ['**/*.js'],\n      contentRegExp: /test/,\n    },\n  }\n).then(files =\u003e {\n  // ...\n})\n```\n\n## API\n\n### matcher.match(criteria)\n\nReturns a Promise, resolved with an array of filepaths that matched the criteria.\n\n- **path:** Path to search. Example: `./src/`\n- **filter:** Options for filtering files.\n  - **namePatterns:** Glob patterns for looking for files. Example: `['**/*.js']`. Default: `[]`.\n  - **contentRegExp:** Regular expression to match file content, ie: `/test/i`. Default: `null`.\n  - **readOptions:** These options will be used in the Node.js `fs.ReadFile` function. Default: `{ encoding:'utf8', flag: 'r' }`\n- **recursiveDepth:** Specify the max depth when searching recursively from the given path. Default: `0`.\n- **readFileConcurrency:** The concurrency behavior for reading files. Useful when we search from a large folder which may cause `EMFILE: too many open files` errors. Default: `1000`\n- **micromatchOptions:** These options will be used in `micromatch.match` function. For more details, refer to [micromatch#options](https://github.com/micromatch/micromatch#options).\n\n## Command Line Interface\n\n```\nUsage: file-content-matcher [options]\n\nOptions:\n  -v, --version                                 output the version number\n  -p, --path \u003cpath\u003e                             set the path to be searched (default:\n                                                process.cwd())\n  -n, --namePatterns \u003c**/*.js,...\u003e              set glob patterns for looking for files (default:\n                                                [])\n  -c, --contentRegExp \u003c/test/i\u003e                 set regular expression to match file content (default: null)\n  -d, --depth \u003cnumber\u003e                          set the depth while searching recursively from the given\n                                                path (default: 0)\n  -concurrency, --readFileConcurrency \u003cnumber\u003e  set the concurrency behavior for reading files\n                                                (default: 1000)\n\n```\n\nBelow is an example:\n\n```\n$ file-content-matcher -p ./test/testFiles -n \"**/*.js,\\!*.less\" -c \"Modal.*@\\/components\"\n```\n\n## Test\n\n```\nnpm test\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperraytin%2Ffile-content-matcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperraytin%2Ffile-content-matcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperraytin%2Ffile-content-matcher/lists"}