{"id":23092290,"url":"https://github.com/sourcefrog/nutmeg","last_synced_at":"2025-08-16T10:30:46.643Z","repository":{"id":43656229,"uuid":"451726181","full_name":"sourcefrog/nutmeg","owner":"sourcefrog","description":"A flexible model/view Rust progress bar library","archived":false,"fork":false,"pushed_at":"2024-01-15T02:08:35.000Z","size":285,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-03-15T02:47:23.198Z","etag":null,"topics":["progress-bar","rust","terminal"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/sourcefrog.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}},"created_at":"2022-01-25T03:49:34.000Z","updated_at":"2023-12-09T15:16:18.000Z","dependencies_parsed_at":"2023-12-15T00:23:52.458Z","dependency_job_id":"824e9856-d585-4ddf-bb7b-3a592119e879","html_url":"https://github.com/sourcefrog/nutmeg","commit_stats":{"total_commits":147,"total_committers":1,"mean_commits":147.0,"dds":0.0,"last_synced_commit":"2d10f07580e038040f9ea72b0cc9cc65b3316104"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Fnutmeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Fnutmeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Fnutmeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcefrog%2Fnutmeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcefrog","download_url":"https://codeload.github.com/sourcefrog/nutmeg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230028326,"owners_count":18161887,"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":["progress-bar","rust","terminal"],"created_at":"2024-12-16T21:32:03.010Z","updated_at":"2024-12-16T21:32:03.571Z","avatar_url":"https://github.com/sourcefrog.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nutmeg - an unopinionated progress bar library\n\n\u003chttps://github.com/sourcefrog/cargo-mutants\u003e\n\n[![Tests](https://github.com/sourcefrog/nutmeg/actions/workflows/tests.yml/badge.svg?branch=main\u0026event=push)](https://github.com/sourcefrog/nutmeg/actions/workflows/tests.yml?query=branch%3Amain)\n[![docs.rs](https://docs.rs/nutmeg/badge.svg)](https://docs.rs/nutmeg)\n[![crates.io](https://img.shields.io/crates/v/nutmeg.svg)](https://crates.io/crates/nutmeg)\n[![libs.rs](https://img.shields.io/badge/libs.rs-nutmeg-blue)](https://lib.rs/crates/nutmeg)\n![Maturity: Beta](https://img.shields.io/badge/maturity-beta-blue.svg)\n\nNutmeg draws terminal progress indicators while giving the application complete\ncontrol over their appearance and content.\n\nFor more information: \u003chttps://docs.rs/nutmeg\u003e\n\nLicense: MIT\n\n## Example\n\nFrom `examples/basic.rs`:\n\n```rust\nuse std::io::Write; // to support write!()\n\n// 1. Define a struct holding all the application state necessary to\n// render the progress bar.\n#[derive(Default)]\nstruct Model {\n    i: usize,\n    total: usize,\n    last_file_name: String,\n}\n\n// 2. Define how to render the progress bar as a String.\nimpl nutmeg::Model for Model {\n    fn render(\u0026mut self, _width: usize) -\u003e String {\n        format!(\"{}/{}: {}\", self.i, self.total, self.last_file_name)\n    }\n}\n\nfn main() -\u003e std::io::Result\u003c()\u003e {\n    // 3. Create a View when you want to draw a progress bar.\n    let mut view = nutmeg::View::new(Model::default(),\n        nutmeg::Options::default());\n\n    // 4. As the application runs, update the model via the view.\n    let total_work = 100;\n    view.update(|model| model.total = total_work);\n    for i in 0..total_work {\n        view.update(|model| {\n            model.i += 1;\n            model.last_file_name = format!(\"file{}.txt\", i);\n        });\n        // 5. Interleave text output lines by writing to the view.\n        if i % 10 == 3 {\n            writeln!(view, \"reached {}\", i)?;\n        }\n        std::thread::sleep(std::time::Duration::from_millis(100));\n    }\n\n    // 5. The bar is automatically erased when dropped.\n    Ok(())\n}\n```\n\n[![asciicast](https://asciinema.org/a/oPI37ohOY8yhDxomTzHCsR4sw.svg)](https://asciinema.org/a/oPI37ohOY8yhDxomTzHCsR4sw)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcefrog%2Fnutmeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcefrog%2Fnutmeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcefrog%2Fnutmeg/lists"}