{"id":13844665,"url":"https://github.com/ysf/anewer","last_synced_at":"2025-07-12T00:31:00.913Z","repository":{"id":43161432,"uuid":"310341646","full_name":"ysf/anewer","owner":"ysf","description":"anewer appends lines from stdin to a file if they don't already exist in the file. This is a rust version of https://github.com/tomnomnom/anew","archived":false,"fork":false,"pushed_at":"2022-10-17T15:41:21.000Z","size":57,"stargazers_count":58,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-07T01:47:46.762Z","etag":null,"topics":["bugbounty","cli","rust","stdin","stdout","tool","uniq"],"latest_commit_sha":null,"homepage":"https://github.com/ysf/anewer","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ysf.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}},"created_at":"2020-11-05T15:31:09.000Z","updated_at":"2024-09-28T04:46:17.000Z","dependencies_parsed_at":"2022-09-26T18:21:30.284Z","dependency_job_id":null,"html_url":"https://github.com/ysf/anewer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysf%2Fanewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysf%2Fanewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysf%2Fanewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysf%2Fanewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ysf","download_url":"https://codeload.github.com/ysf/anewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225295076,"owners_count":17451618,"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":["bugbounty","cli","rust","stdin","stdout","tool","uniq"],"created_at":"2024-08-04T17:02:50.987Z","updated_at":"2024-11-21T17:30:39.409Z","avatar_url":"https://github.com/ysf.png","language":"Rust","readme":"# anewer [![crates.io][crates-img]][crates] [![@ysfr][twitter-img]][twitter]\nanewer appends lines from stdin to a file if they don't already exist in the file. You could also use it as `uniq` without `sort`. This is a rust version of [tomnomnom/anew](https://github.com/tomnomnom/anew). It makes use of [tkaitchuck/aHash](https://github.com/tkaitchuck/aHash) to cut down runtime to ~50%. Since only hashed lines are held in memory, it cuts down memory usage for inputs with long lines. Which is similar how [`huniq`](https://crates.io/crates/huniq) works.\n\n[twitter-img]:  https://img.shields.io/badge/twitter-@ysfr-blue.svg\n[twitter]:      https://twitter.com/ysfr\n[crates-img]:   https://img.shields.io/crates/v/anewer.svg\n[crates]:       https://crates.io/crates/anewer\n\n## Usage\n\n```\n$ anewer -h\nUSAGE:\n    anewer [FLAGS] [filename]\n\nFLAGS:\n    -n, --dry-run    Dry run, will leave the file as it is\n    -h, --help       Prints help information\n    -v, --invert     Invert the sense of matching\n    -q, --quiet      Quiet, won't print to stdout\n    -V, --version    Prints version information\n\nARGS:\n    \u003cfilename\u003e\n```\n\n## Installation\n\n```\ncargo install anewer\n```\n\n#### Add unknown elements of newthings.txt to things.txt\n```\n$ cat things.txt\nZero\nOne\nTwo\n\n$ cat newthings.txt\nOne\nTwo\nThree\nFour\n\n$ cat newthings.txt | anewer things.txt\nThree\nFour\n\n$ cat things.txt\nZero\nOne\nTwo\nThree\nFour\n```\n\n#### Or use it as simple uniq without sort\n```\n$ cat list.txt\nOne\nOne\nTwo\nTwo\nThree\nFour\nThree\nFour\n\n$ cat list.txt | anewer\nOne\nTwo\nThree\nFour\n```\n\n# License\nGPLv3+\n","funding_links":[],"categories":["Rust (42)","Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysf%2Fanewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fysf%2Fanewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysf%2Fanewer/lists"}