{"id":13822642,"url":"https://github.com/hjson/hjson-rust","last_synced_at":"2025-05-16T16:05:34.819Z","repository":{"id":50255360,"uuid":"61158319","full_name":"hjson/hjson-rust","owner":"hjson","description":"Hjson for Rust","archived":false,"fork":false,"pushed_at":"2024-09-25T13:22:37.000Z","size":817,"stargazers_count":111,"open_issues_count":2,"forks_count":33,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-01T17:54:38.448Z","etag":null,"topics":["hjson","rust","serde"],"latest_commit_sha":null,"homepage":"https://hjson.github.io/","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/hjson.png","metadata":{"files":{"readme":"README.md","changelog":"history.md","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":"2016-06-14T21:54:59.000Z","updated_at":"2025-03-27T04:58:41.000Z","dependencies_parsed_at":"2024-11-14T12:51:38.776Z","dependency_job_id":null,"html_url":"https://github.com/hjson/hjson-rust","commit_stats":{"total_commits":38,"total_committers":7,"mean_commits":5.428571428571429,"dds":"0.21052631578947367","last_synced_commit":"91157fb523ff4f550980125a386457b312d68b87"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjson%2Fhjson-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hjson","download_url":"https://codeload.github.com/hjson/hjson-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931507,"owners_count":21827112,"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":["hjson","rust","serde"],"created_at":"2024-08-04T08:02:10.620Z","updated_at":"2025-05-16T16:05:34.796Z","avatar_url":"https://github.com/hjson.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# hjson-rust for serde\n\n[![Build Status](https://github.com/hjson/hjson-rust/workflows/test/badge.svg)](https://github.com/hjson/hjson-rust/actions)\n[![crate](https://img.shields.io/crates/v/serde-hjson.svg?style=flat-square)](https://crates.io/crates/serde-hjson)\n\n![Hjson Intro](https://hjson.github.io/hjson1.gif)\n\n```\n{\n  # specify rate in requests/second (because comments are helpful!)\n  rate: 1000\n\n  // prefer c-style comments?\n  /* feeling old fashioned? */\n\n  # did you notice that rate doesn't need quotes?\n  hey: look ma, no quotes for strings either!\n\n  # best of all\n  notice: []\n  anything: ?\n\n  # yes, commas are optional!\n}\n```\n\nThe Rust implementation of Hjson is based on the [Serde JSON Serialization Library](https://github.com/serde-rs/json). For other platforms see [hjson.github.io](https://hjson.github.io).\n\nThis crate is a Rust library for parsing and generating Human JSON [Hjson](https://hjson.github.io). It is built upon [Serde](https://github.com/serde-rs/serde), a high performance generic serialization framework.\n\n# Install\n\nThis crate works with Cargo and can be found on [crates.io](https://crates.io/crates/serde-hjson) with a `Cargo.toml` like:\n\n```toml\n[dependencies]\nserde = \"*\"\nserde-hjson = \"*\"\n```\n\n## From the Commandline\n\nInstall with `cargo install hjson`\n\n```\nHjson, the Human JSON.\n\nUsage:\n  hjson [options]\n  hjson [options] \u003cinput\u003e\n  hjson (-h | --help)\n  hjson (-V | --version)\n\nOptions:\n  -h --help     Show this screen.\n  -j            Output as formatted JSON.\n  -c            Output as JSON.\n  -V --version  Show version.\n```\n\nSample:\n- run `hjson test.json \u003e test.hjson` to convert to Hjson\n- run `hjson -j test.hjson \u003e test.json` to convert to JSON\n\n\n# Usage\n\n```rust\nextern crate serde;\nextern crate serde_hjson;\n\nuse serde_hjson::{Map,Value};\n\nfn main() {\n\n    // Now let's look at decoding Hjson data\n\n    let sample_text=r#\"\n    {\n        // specify rate in requests/second\n        rate: 1000\n        array:\n        [\n            foo\n            bar\n        ]\n    }\"#;\n\n    // Decode and unwrap.\n    let mut sample: Map\u003cString, Value\u003e = serde_hjson::from_str(\u0026sample_text).unwrap();\n\n    // scope to control lifetime of borrow\n    {\n        // Extract the rate\n        let rate = sample.get(\"rate\").unwrap().as_f64().unwrap();\n        println!(\"rate: {}\", rate);\n\n        // Extract the array\n        let array : \u0026mut Vec\u003cValue\u003e = sample.get_mut(\"array\").unwrap().as_array_mut().unwrap();\n        println!(\"first: {}\", array.get(0).unwrap());\n\n        // Add a value\n        array.push(Value::String(\"tak\".to_string()));\n    }\n\n    // Encode to Hjson\n    let sample2 = serde_hjson::to_string(\u0026sample).unwrap();\n    println!(\"Hjson:\\n{}\", sample2);\n}\n```\n\n# API\n\n[see Rust doc](http://hjson.github.io/hjson-rust/serde_hjson/)\n\n# History\n\n[see history.md](history.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjson%2Fhjson-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhjson%2Fhjson-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjson%2Fhjson-rust/lists"}