{"id":28212545,"url":"https://github.com/jkaraskiewicz/commons","last_synced_at":"2025-09-05T12:45:58.426Z","repository":{"id":285639705,"uuid":"948661133","full_name":"jkaraskiewicz/commons","owner":"jkaraskiewicz","description":"Small private common library","archived":false,"fork":false,"pushed_at":"2025-04-14T22:18:02.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T10:46:34.295Z","etag":null,"topics":["common","std","stdlib"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jkaraskiewicz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-14T18:17:28.000Z","updated_at":"2025-04-14T22:18:06.000Z","dependencies_parsed_at":"2025-04-01T22:28:23.083Z","dependency_job_id":"6cf57947-6d2d-4810-9003-2e562e9a2a8e","html_url":"https://github.com/jkaraskiewicz/commons","commit_stats":null,"previous_names":["jkaraskiewicz/commons"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jkaraskiewicz/commons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaraskiewicz%2Fcommons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaraskiewicz%2Fcommons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaraskiewicz%2Fcommons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaraskiewicz%2Fcommons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkaraskiewicz","download_url":"https://codeload.github.com/jkaraskiewicz/commons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkaraskiewicz%2Fcommons/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076035,"owners_count":23872729,"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":["common","std","stdlib"],"created_at":"2025-05-17T19:09:02.474Z","updated_at":"2025-07-20T06:04:20.893Z","avatar_url":"https://github.com/jkaraskiewicz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Commons\n\nA collection of reusable utilities for Rust projects.\n\n## Features\n\nThis library provides a set of modules to simplify common tasks in Rust applications.\n\n### Traits\n\n- **`collections`**: Extends collections with `contains`, `contains_predicate`, and `first` methods.\n- **`result`**: Adds a `to_result` method to `bool` for easy conversion to a `Result`.\n\n### Types\n\n- **`errors`**: Defines a common `CommonsError` enum for handling I/O and environment variable errors.\n\n### Utils\n\n- **`datetime_util`**: Functions for working with dates and times, including getting the current date, timestamp, and formatting `SystemTime`.\n- **`file_util`**: Utilities for reading, writing, deleting, and copying files and directories.\n- **`hash_util`**: Functions for generating SHA256 hashes for strings and files, and for creating unique IDs.\n- **`path_util`**: Utilities for expanding the home directory (`~`) in paths and getting the home directory path.\n- **`shell_util`**: Functions for executing shell commands.\n- **`string_util`**: A utility for finding the minimum unique prefix of a string within a list of strings.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\ncommons = \"0.2.6\"\n```\n\nThen, you can use the utilities in your code:\n\n```rust\nuse commons::utils::file_util;\n\nfn main() {\n    let content = file_util::read_file(\"path/to/your/file.txt\").unwrap();\n    println!(\"{}\", content);\n}\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkaraskiewicz%2Fcommons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkaraskiewicz%2Fcommons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkaraskiewicz%2Fcommons/lists"}