{"id":51172281,"url":"https://github.com/jsmonhq/xnew","last_synced_at":"2026-06-27T01:30:24.316Z","repository":{"id":359851200,"uuid":"1212200423","full_name":"jsmonhq/xnew","owner":"jsmonhq","description":"xnew is a fast, low-memory CLI that appends only unique lines to files. Built in Go for large datasets, it streams input efficiently and scales cleanly from thousands to hundreds of millions of lines.","archived":false,"fork":false,"pushed_at":"2026-05-23T18:19:00.000Z","size":22,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-23T20:14:26.322Z","etag":null,"topics":["bugbounty","cli","cybersecurity","data-analysis","data-processing","deduplication","go","golang","infosec","performance","security-tools"],"latest_commit_sha":null,"homepage":"https://jsmon.sh","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsmonhq.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-16T06:45:06.000Z","updated_at":"2026-05-23T18:19:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jsmonhq/xnew","commit_stats":null,"previous_names":["jsmonhq/xnew"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jsmonhq/xnew","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmonhq%2Fxnew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmonhq%2Fxnew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmonhq%2Fxnew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmonhq%2Fxnew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsmonhq","download_url":"https://codeload.github.com/jsmonhq/xnew/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsmonhq%2Fxnew/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34839004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"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":["bugbounty","cli","cybersecurity","data-analysis","data-processing","deduplication","go","golang","infosec","performance","security-tools"],"created_at":"2026-06-27T01:30:23.715Z","updated_at":"2026-06-27T01:30:24.308Z","avatar_url":"https://github.com/jsmonhq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xnew\n\n`xnew` appends only lines that are not already present in a target file and is tuned for very large inputs with low memory usage.\n\n## Benchmark timings\n\nThe timings below measure the case where we try to write a single line into files that already contain the listed number of lines.\n\nTest instance configuration: `4 GB RAM / 2-core CPU`.\n\n| Number of lines | anew | xnew | Faster |\n|-----------------|------|------|--------|\n| 1K | 0.005s | 0.005s | 1x |\n| 10K | 0.009s | 0.009s | 1x |\n| 100K | 0.070s | 0.031s | 2.26x |\n| 1M | 0.886s | 0.236s | 3.75x |\n| 10M | 12.4773s | 2.830s | 4.41x |\n| 20M | 27.763s | 6.036s | 4.60x |\n| 50M | 56.446s | 16.809s | 3.36x |\n| 100M | 1m38s | 30.534s | 3.21x |\n\n\n\n## Install\n\n```bash\ngo install github.com/jsmonhq/xnew@latest\n```\n\nMake sure `$GOPATH/bin` or `$HOME/go/bin` is in your `PATH`.\n\n## Why xnew\n\n- Streams the existing file instead of loading it entirely into memory.\n- Uses a compact open-addressed `uint64` hash set for fast membership checks.\n- Uses XXH3 for high-throughput hashing.\n- Uses buffered I/O to reduce syscall overhead.\n\n## Trade-off\n\n`xnew` deduplicates using a 64-bit XXH3 hash. Collisions are extremely unlikely in practice, but still theoretically possible. This trade-off significantly reduces memory usage compared with exact byte-span indexing.\n\n## Usage\n\n```bash\n# Append new lines from stdin to existing.txt\ncat new_lines.txt | xnew existing.txt\n\n# Write only new unique lines to a separate file\ncat new_lines.txt | xnew existing.txt -o only_new.txt\n\n# Trim leading/trailing spaces before comparing\ncat new_lines.txt | xnew existing.txt -trim\n\n# Quiet mode (no stdout output, exit code only)\ncat new_lines.txt | xnew existing.txt -q\n```\n\n## Build\n\n```bash\ngit clone https://github.com/jsmonhq/xnew.git\ncd xnew\ngo build -o xnew .\n```\n\n## Flags\n\n| Argument | Description |\n|----------|-------------|\n| `existing-file` | Path to existing file (required). If missing, it is treated as empty. |\n| `-o` | Output file. Default: append to `existing-file`. |\n| `-trim` | Trim spaces before comparing lines. |\n| `-q` | Quiet mode; suppress stdout output. |\n\n## Output behavior\n\nBy default, `xnew` writes only newly added lines to stdout (one per line), so you can pipe or redirect output as needed:\n\n```bash\necho \"example\" | xnew existing.txt \u003e\u003e new.txt\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsmonhq%2Fxnew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsmonhq%2Fxnew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsmonhq%2Fxnew/lists"}