{"id":20671236,"url":"https://github.com/allnulled/matchalize","last_synced_at":"2025-12-24T05:19:53.737Z","repository":{"id":34898295,"uuid":"188046503","full_name":"allnulled/matchalize","owner":"allnulled","description":"Find strings and regular expressions on files and get matches per file and files per match.","archived":false,"fork":false,"pushed_at":"2022-05-29T09:53:31.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-05T04:49:31.225Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allnulled.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}},"created_at":"2019-05-22T13:38:55.000Z","updated_at":"2023-03-03T23:36:41.000Z","dependencies_parsed_at":"2022-08-27T12:20:36.543Z","dependency_job_id":null,"html_url":"https://github.com/allnulled/matchalize","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/allnulled/matchalize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmatchalize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmatchalize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmatchalize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmatchalize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allnulled","download_url":"https://codeload.github.com/allnulled/matchalize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allnulled%2Fmatchalize/sbom","scorecard":{"id":185825,"data":{"date":"2025-08-11","repo":{"name":"github.com/allnulled/matchalize","commit":"ab4b5888ceb7af6981540ee8edc0cc0424349f1b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T19:47:02.989Z","repository_id":34898295,"created_at":"2025-08-16T19:47:02.989Z","updated_at":"2025-08-16T19:47:02.989Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27995845,"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-12-24T02:00:07.193Z","response_time":83,"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-16T20:25:56.176Z","updated_at":"2025-12-24T05:19:53.716Z","avatar_url":"https://github.com/allnulled.png","language":"JavaScript","readme":"# matchalize\n\nFind strings and regular expressions on files and get matches per file and files per match.\n\nIt works from CLI or API.\n\n![](https://img.shields.io/badge/matchalize-v1.0.0-green.svg) ![](https://img.shields.io/badge/tests-passing-green.svg) ![](https://img.shields.io/badge/coverage-80%25--100%25-green.svg)\n\n[![NPM](https://nodei.co/npm/matchalize.png?stars\u0026downloads)](https://www.npmjs.com/package/matchalize)\n\n## Installation\n\n`$ npm i matchalize -g`\n\n### CLI example\n\n1. Given a structure of files like:\n\n```\n$ mkdir somepath\n$ echo \"module.exports = ['File', /[0-9]/g]\" \u003e somepath/input.js\n$ echo '[\"File 1\", \"File 2\", \"File 3\"]' \u003e somepath/input.json\n$ echo \"File 1...\" \u003e somepath/sample-1.txt\n$ echo \"File 2...\" \u003e somepath/sample-2.txt\n$ echo \"File 3...\" \u003e somepath/sample-3.txt\n```\n\n2. And given a command execution like:\n\n```\n$ matchalize\n   --texts     \".\" \"n\"\n   --regex     \"File [0-9]+\"\n   --files     somepath/*.js somepath/*.json\n   --sources   somepath/*.txt\n   --results   somepath/result.json\n   --analysis  somepath/analysis.json\n```\n\nOr, alternatively, an API call like:\n\n```\nrequire(\"matchalize\").run({\n  texts:     [\".\", \"n\"],\n  regex:     \"File [0-9]+\",\n  files:     [\"somepath/*.js\", \"somepath/*.json\"],\n  sources:   \"somepath/*.txt\",\n  results:   \"somepath/result.json\",\n  analysis:  \"somepath/analysis.json\"\n});\n```\n\n4. Expect an output like:\n\n```\n// files/result.json:\n{\n  \"./test/somepath/sample-1.txt\": {\n    \"size\": 10,\n    \"matches\": {\n      \"0\": \"File 1\",\n      \"5\": \"1\",\n      \"6\": \".\",\n      \"7\": \".\",\n      \"8\": \".\"\n    }\n  },\n  \"./test/somepath/sample-2.txt\": {\n    \"size\": 10,\n    \"matches\": {\n      \"0\": \"File 2\",\n      \"5\": \"2\",\n      \"6\": \".\",\n      \"7\": \".\",\n      \"8\": \".\"\n    }\n  },\n  \"./test/somepath/sample-3.txt\": {\n    \"size\": 10,\n    \"matches\": {\n      \"0\": \"File 3\",\n      \"5\": \"3\",\n      \"6\": \".\",\n      \"7\": \".\",\n      \"8\": \".\"\n    }\n  }\n}\n```\n\n```\n// files/analysis.json:\n[\n  {\n    \"name\": \".\",\n    \"total\": 9,\n    \"files\": {\n      \"./test/somepath/sample-1.txt\": 3,\n      \"./test/somepath/sample-2.txt\": 3,\n      \"./test/somepath/sample-3.txt\": 3\n    }\n  },\n  {\n    \"name\": \"/File [0-9]+/g\",\n    \"total\": 3,\n    \"files\": {\n      \"./test/somepath/sample-1.txt\": 1,\n      \"./test/somepath/sample-2.txt\": 1,\n      \"./test/somepath/sample-3.txt\": 1\n    }\n  },\n  {\n    \"name\": \"File\",\n    \"total\": 3,\n    \"files\": {\n      \"./test/somepath/sample-1.txt\": 1,\n      \"./test/somepath/sample-2.txt\": 1,\n      \"./test/somepath/sample-3.txt\": 1\n    }\n  },\n  {\n    \"name\": \"/[0-9]/g\",\n    \"total\": 3,\n    \"files\": {\n      \"./test/somepath/sample-1.txt\": 1,\n      \"./test/somepath/sample-2.txt\": 1,\n      \"./test/somepath/sample-3.txt\": 1\n    }\n  },\n  {\n    \"name\": \"File 1\",\n    \"total\": 1,\n    \"files\": {\n      \"./test/somepath/sample-1.txt\": 1\n    }\n  },\n  {\n    \"name\": \"File 2\",\n    \"total\": 1,\n    \"files\": {\n      \"./test/somepath/sample-2.txt\": 1\n    }\n  },\n  {\n    \"name\": \"File 3\",\n    \"total\": 1,\n    \"files\": {\n      \"./test/somepath/sample-3.txt\": 1\n    }\n  }\n]\n```\n\nTo see this same example go to `/test/matchalize.readme.test.js`.\n\n## Usage\n\nThe CLI and the API work almost the same.\n\nThe CLI passes its options through `--option value1 value2 value3`.\n\nThe API passes its options through `{option: [value1, value2, value3]}`.\n\nAlso, the API returns the information in an object, beside dumping results (if specified).\n\nBy default, the CLI dumps the results at `results.{DATE}.json` and `analysis.{DATE}.json`.\n\nTo see the options from the CLI, just type:\n\n`$ matchalize`\n\n#### Options\n\nThe options below are the parameters of the CLI.\n\nNote that only `--sources` is **required**:\n\n- `--texts`: (*optional*, *array*) strings that are searched for in the sources, passed directly as plain text.\n\n- `--regex`: (*optional*, *array*) regular expressions that are searched for in the sources, passed directly as plain text. They will be the text of the javascript `RegExp`.\n\n- `--files`: (*optional*, *array*) javascript or `.json` files passed as strings or regular expressions. The `.json` files can only contain strings. The other type of files will be understood as `.js` files, and what they export is what they pass to the tool, so they can contain both, strings or regular expressions. This parameter accepts `glob` patterns.\n\n- `--sources`: (**REQUIRED**, *string*) files that will be used to search for the strings and regular expressions provided by the previous options. This parameter accepts `glob` patterns.\n\n- `--results`: (*optional*, *string*) file into which the tool will dump the results file. \n\nThis file shows the positions of each match per file.\n\nThis file has this shape:\n\n```\n{\n  \"\u003cfile\u003e\": {\n    size: \u003csize of the file\u003e,\n    matches: {\n      \"\u003cposition\u003e\": \"\u003cunique match\u003e\" OR [\"\u003cmatch 1\u003e\", \u003cmatch 2\u003e\", ...],\n      \"\u003cposition\u003e\": \"\u003cunique match\u003e\" OR [\"\u003cmatch 1\u003e\", \u003cmatch 2\u003e\", ...],\n      ...\n    }\n  },\n  ...\n}\n```\n\nThis file sorts the files by their size.\n\n- `--analysis`: (*optional*, *string*) the file into which the tool will dump the analyisis file.  \n\nThis file has this shape:\n\n```\n[\n  {\n    \"name\": \"\u003cstring or pattern\u003e\",\n    \"total\": \u003ctotal occurrences\u003e,\n    \"files\": {\n      \"\u003cfile\u003e\": \u003ctotal occurrences in file\u003e,\n      \"\u003cfile\u003e\": \u003ctotal occurrences in file\u003e,\n      ...\n    }\n  },\n  ...\n]\n```\n\n## Issues\n\nIssues [here](https://github.com/allnulled/matchalize/issues/new).\n\n## Tests and coverage\n\nTo run tests and coverage, please, type:\n\n`$ npm run test`\n\n`$ npm run coverage`\n\n## License\n\nThis project is under [WTFL](https://es.wikipedia.org/wiki/WTFPL). Feel free to do whatever you want.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallnulled%2Fmatchalize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallnulled%2Fmatchalize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallnulled%2Fmatchalize/lists"}