{"id":22221939,"url":"https://github.com/fabiospampinato/grepgrep","last_synced_at":"2025-07-27T16:31:49.718Z","repository":{"id":243449521,"uuid":"805892942","full_name":"fabiospampinato/grepgrep","owner":"fabiospampinato","description":"A grep-like command that uses JavaScript-flavored regular expressions.","archived":false,"fork":false,"pushed_at":"2024-06-20T23:11:11.000Z","size":248,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-27T05:39:52.756Z","etag":null,"topics":["ecmascript","grep","grepgrep","javascript","regex","regexp"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/fabiospampinato.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},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2024-05-25T19:09:04.000Z","updated_at":"2024-10-06T10:23:37.000Z","dependencies_parsed_at":"2024-06-18T23:33:37.330Z","dependency_job_id":null,"html_url":"https://github.com/fabiospampinato/grepgrep","commit_stats":null,"previous_names":["fabiospampinato/grepgrep"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgrepgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgrepgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgrepgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgrepgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/grepgrep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227817017,"owners_count":17824200,"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":["ecmascript","grep","grepgrep","javascript","regex","regexp"],"created_at":"2024-12-02T23:16:18.344Z","updated_at":"2024-12-02T23:16:19.130Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./resources/banner.png\" alt=\"GrepGreps's Banner\" width=\"640px\" height=\"320px\"\u003e\n\u003c/p\u003e\n\n# GrepGrep (gg)\n\nA [`grep`](https://www.gnu.org/software/grep)-like command that uses JavaScript-flavored regular expressions.\n\nThis is significantly inspired by, and tested against, the wonderful [`ripgrep`](https://github.com/BurntSushi/ripgrep).\n\n## Features\n\n- Regexes are expressed in JavaScript's flavor of regular expressions.\n- Regexes that match this regex: `^/(.*)/([a-z]*)$`, will automatically be split into their source and flags parts.\n- Regexes are always executed in something equivalent to `ripgrep`'s \"multiline\" mode.\n- Binary files are ignored by default, like in `ripgrep`.\n- Hidden files/folders are ignored by default, like in `ripgrep`.\n- Ignored files/folders are not searched into by default, like in `ripgrep`.\n- Searching inside a folder always automatically searches into it recursively.\n- Searching using globs as targets, expressed in [`zeptomatch`](https://github.com/fabiospampinato/zeptomatch)'s flavor, is supported too.\n- The sorting order of the output is always deterministic, unlike in `ripgrep`.\n- The most common flags from `grep` and `ripgrep` should be supported.\n\n## Misfeatures\n\n- Searching in parallel is supported to some degree, but it's opt-in, since worker threads in JS are pretty bad and they end up making this command slower in many cases...\n- Some flags you may be used to could be missing here, please open an issue about what you need.\n\n## Install\n\n```sh\nnpm install -g grepgrep\n```\n\n## Usage\n\n```\ngg 0.1.2\n\nUSAGE\n\n  gg [pattern] [targets...]\n  gg needle src\n  gg /^needle/mi src --max-filesize 50K\n  gg needle src -i\n  gg needle 'node_modules/**/*.js'\n  gg $'ascii\\'string' src --no-ignore --hidden\n\nARGUMENTS\n\n  [pattern]     The JavaScript regex to search for\n  [targets...]  The files or directories to search into, or globs\n\nOPTIONS\n\n  --help                              Display help for the command\n  --version, -v                       Display the version number\n  --after-context, -A \u003cnumber\u003e        Print this number of lines after each match\n  --before-context, -B \u003cnumber\u003e       Print this number of lines before each match\n  --binary                            Search into binary files too\n  --byte-offset, -b                   Print the byte offset for each match\n  --context, -C \u003cnumber\u003e              Print this number of lines before and after each match\n  --context-separator \u003cstring\u003e        The string to print between non-adjacent output lines\n  --count, -c                         Print only the number of line matches\n  --count-matches                     Print only the number of individual matches\n  --field-context-separator \u003cstring\u003e  The string to print in the gutter for context lines\n  --field-match-separator \u003cstring\u003e    The string to print in the gutter for matching lines\n  --filename, -H                      Print file names before each match\n  --files                             Print the paths of files that would be searched into\n  --files-with-match, -l              Print only the paths of files with matches\n  --files-without-match, -L           Print only the paths of files without matches\n  --fixed-strings, -F                 Treat the pattern as a literal string instead of a regex\n  --heading                           Print file names as headings before the matches for each file\n  --hidden, -.                        Search into hidden files and hidden directories too\n  --ignore-case, -i                   Ignore the casing when searching\n  --line-number, -n                   Print the line number for each match\n  --line-regexp, -x                   Consider only matches surrounded by line boundaries\n  --max-count, -m \u003cnumber\u003e            Maximum number of matching lines to print\n  --max-depth, -d \u003cnumber\u003e            Maximum directories depth to search into\n  --max-filesize \u003cnumber+suffix?\u003e     Maximum size of each file to search into, with optional G/M/K/B suffix\n  --min-filesize \u003cnumber+suffix?\u003e     Minimum size of each file to search into, with optional G/M/K/B suffix\n  --no-ignore                         Do not respect .gitignore, .ignore and .rgignore files\n  --no-ignore-dot                     Do not respect .ignore and .rgignore files\n  --no-ignore-parent                  Do not look for ignore files above the current work directory\n  --no-ignore-vcs                     Do not respect .gitignore files\n  --only-matching, -o                 Print only the matched parts in each line, individually\n  --passthru                          Print all lines in each file\n  --quiet, -q                         Do not print anything to stdout\n  --sort \u003cdimension\u003e                  Sort results ascendingly by accessed/created/modified/path/size\n  --sortr \u003cdimension\u003e                 Sort results descendingly by accessed/created/modified/path/size\n  --threads, -j \u003cnumber\u003e              Number of worker threads to use for searching\n  --type, -t \u003cextensions...\u003e          Search only into files with the specified extensions\n  --type-not, -T \u003cextensions...\u003e      Do not search into files with the specified extensions\n  --word-regexp, -w                   Consider only matches surrounded by word boundaries\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fgrepgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fgrepgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fgrepgrep/lists"}