{"id":24340883,"url":"https://github.com/bitlytwiser/nostro","last_synced_at":"2026-05-28T07:31:37.691Z","repository":{"id":272792547,"uuid":"908008488","full_name":"BitlyTwiser/nostro","owner":"BitlyTwiser","description":"Nostro recursively searches directories for a given input string","archived":false,"fork":false,"pushed_at":"2025-01-16T16:54:49.000Z","size":108,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T17:42:00.462Z","etag":null,"topics":["file-system","zig","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/BitlyTwiser.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":"2024-12-24T21:16:29.000Z","updated_at":"2025-01-16T16:50:12.000Z","dependencies_parsed_at":"2025-01-16T17:42:03.832Z","dependency_job_id":"d9955ffe-293d-4c9a-a702-cf4900b4fd6e","html_url":"https://github.com/BitlyTwiser/nostro","commit_stats":null,"previous_names":["bitlytwiser/nostro"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fnostro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fnostro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fnostro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitlyTwiser%2Fnostro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BitlyTwiser","download_url":"https://codeload.github.com/BitlyTwiser/nostro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243104603,"owners_count":20236997,"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":["file-system","zig","ziglang"],"created_at":"2025-01-18T07:12:31.113Z","updated_at":"2025-12-25T07:29:32.207Z","avatar_url":"https://github.com/BitlyTwiser.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e \n\n\u003cimg src=\"/assets/logo.jpg\" width=\"450\" height=\"500\"\u003e\n\n# nostro\nNostro recursively searches directories for a user provided inputs.\n\n# Contents\n[Inputs](#inputs) |\n[Usage](#usage) |\n[Examples](#examples) |\n[Benchmarks](#benchmarks) |\n[Corpus](#corpus) |\n[Limitations](#limitations) |\n[Honorable Mentions](#honorable-mentions) |\n\n\u003c/div\u003e\n\n## Inputs\nAll flags are optional, if no flags (other than the mandatory `term` flag) are passed, then nostro hunt for any exact matches (strings containing the given term). Otherwise, the flags will be incorporated into the search to refine the findings.\n\nNote: *all* flags are treated as *or* statements when entered. If you enter `-e` and `-p` nostro assumes you desire *either* of the given elements to be present, so it will match if the prefix or regex match.\n\nNostro uses the following flags to denote search string:\n\nMandatory flags:\n```bash\n-term=\"word to search\"\n```\n\nOptional flags to refine search:\n\n```bash\n-path=\"path\" // If path is not set, nostro will start from the root of your OS. THis can take a while, so generally its recommended to set a directory.\n\n-t=\"f or d\" // Denotes if you are searching for a file or a directory. Default is to search for files unless specified otherwise\n\n-e=Optional (optional: true)\n\n-i=Optional (optional: true)\n```\n\n## Usage\n\n### Regular expression\nUtilizing the `-e=true` flag will expect a regular expression in the term field for matching/parsing of files/directories.\n\nExample:\nfrom the benchmarking code, you can ascertain the following example:\n```bash\n./zig-out/bin/nostro -term='[A-Z]\\w+' -path=\"../linux\" -e=true -t=f\n```\n\nUtilizing `-i` will lowercase cast the input strings to avoid any case sensitive matching.\n\n`-t` denotes the file type. You can use: `t=d` for directory searches or just leave the default in place which searches files.\n\n### Paths\nYou can use either relative paths `../` or absolute paths `/home/user/Documents` for the `-path` argument.\n\n### Outputs\nThe output is similiar to egrep. The values, if found, are printed on individual lines to be viewed by the user\n\n## Examples\nExamples:\n```bash\n./zig-out/bin/nostro -term=\"firm\" -path=\"../linux\" -i=true -t=f\n./zig-out/bin/nostro -term=\"licenses\" -path=\"../linux\" -i=true -t=d\n./zig-out/bin/nostro -term=\"(fi)\" -path=\"../linux\" -e=true \n```\n\n## Benchmarks\nNote: I did not make this application in any attempt to beat any existing tools out there (since plenty do this *exact* thing), but just a quick item to curate over an hour or two to try out different Zig regex engines. I did toss benchmarks in here simply for fun and to satiate my inner data nerd. \n\nI did not parake in establishing a fancy benchmarking enviornment, I utilized the following command to run the code with FIFO priority 99 on an Ubuntu liunux system to ensure CPU context switching would not interfere with the code execution:\n\n```bash\nsudo chrt -f 99 /usr/bin/time --verbose \u003cbenchmark\u003e\n```\n\n```bash\nsudo chrt -f 99 /usr/bin/time --verbose ./zig-out/bin/nostro -term='[A-Z]\\w+' -path=\"../linux\" -e=true -t=f\n```\n\nResults:\n![Benchmark](./assets/benchmarks.png)\n\n## Corpus\nThe linux kernel code was utilized for these expiriments: https://github.com/BurntSushi/linux\nIt is a rather robust download, but offered a decently sized allotment of data to attempt to parse.\n\n## Limitations\nNostro (currently) does not read files for the given input strings, Nostro simply parses the files on disk to ascertain file names, not contents. \nIf you wish to parse the contents of files, use [Ripgrep](https://github.com/BurntSushi/ripgrep) or a similiar application.\n\n\n## Honorable Mentions\nInitially, I thought I would re-create the wheel and make a regex parsing libary (naturally this seemed like the best idea :3 ). \n\nAfter some rigerous internal debate, I decided to attempt to utilize the existing Zig packages out there to see what would would best for my needs before embarking on that journey. After trying a few I landed on [mvzr](https://github.com/mnemnion/mvzr)\nGo checkout the repo and such if you like the work :) It works well and its pretty quick and efficient\n\n[Top](#contents)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitlytwiser%2Fnostro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitlytwiser%2Fnostro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitlytwiser%2Fnostro/lists"}