{"id":26496936,"url":"https://github.com/powerumc/figment-json5","last_synced_at":"2026-02-01T20:03:14.728Z","repository":{"id":269370054,"uuid":"907207574","full_name":"powerumc/figment-json5","owner":"powerumc","description":"This crate provides a Figment provider for JSON5 format. JSON5 is a superset of JSON that allows comments, trailing commas, and more.","archived":false,"fork":false,"pushed_at":"2024-12-23T09:14:16.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T03:55:52.328Z","etag":null,"topics":["figment","json5","rust-crate"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/figment-json5","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/powerumc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2024-12-23T04:34:56.000Z","updated_at":"2024-12-23T09:14:20.000Z","dependencies_parsed_at":"2024-12-23T18:01:13.302Z","dependency_job_id":null,"html_url":"https://github.com/powerumc/figment-json5","commit_stats":null,"previous_names":["powerumc/figment-json5"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerumc%2Ffigment-json5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerumc%2Ffigment-json5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerumc%2Ffigment-json5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerumc%2Ffigment-json5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/powerumc","download_url":"https://codeload.github.com/powerumc/figment-json5/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244618417,"owners_count":20482317,"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":["figment","json5","rust-crate"],"created_at":"2025-03-20T13:00:28.270Z","updated_at":"2026-02-01T20:03:14.684Z","avatar_url":"https://github.com/powerumc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Figment JSON5 Provider [![ci.svg]][ci] [![crates.io]][crate] [![docs.rs]][docs]\n\n[Figment](https://docs.rs/figment/latest/figment/) provider for [JSON5](https://json5.org/) format\n\n[examples/config.json5](./examples/config.json5)\n\n```json5\n{\n  // Allow comments\n  \"name\": \"json5\",\n  \"age\": 0x28, // Allow hexadecimal numbers\n  \"description\": \"This is a \\\ntest config\", // Allow multiline strings\n  \"leadingDecimalPoint\": .8675309,\n  \"andTrailing\": 8675309.,\n  \"positiveSign\": +1,\n  \"address\": \"Seoul\", // Allow trailing commas\n}\n```\n\n```rust\nuse figment::Figment;\nuse figment::providers::Format;\nuse serde::Deserialize;\nuse figment_json5::Json5;\n\n#[derive(Debug, Deserialize)]\nstruct Config {\n    name: String,\n    description: String,\n\n    #[serde(rename = \"leadingDecimalPoint\")]\n    leading_decimal_point: f64,\n\n    #[serde(rename = \"andTrailing\")]\n    and_trailing: f64,\n\n    #[serde(rename = \"positiveSign\")]\n    positive_sign: i32,\n\n    age: u32\n}\n\nfn main() {\n    let config: Config = Figment::new()\n        .merge(Json5::file(\"./examples/config.json5\"))\n        .extract()\n        .unwrap();\n\n    println!(\"{:#?}\", config)\n\n    // print result\n    /*\nConfig {\n    name: \"json5\",\n    description: \"This is a test config\",\n    leading_decimal_point: 0.8675309,\n    and_trailing: 8675309.0,\n    positive_sign: 1,\n    age: 40,\n}\n    */\n}\n```\n\n# Overview\n\nThis crate provides a [Figment](https://docs.rs/figment/latest/figment/) provider for JSON5 format.\nJSON5 is a superset of JSON that allows comments, trailing commas, and more.\n\n[What is JSON5?](https://json5.org/)\n\u003e JSON5 is an extension to the popular JSON file format\n\u003e that aims to be easier to write and maintain by hand (e.g. for config files).\n\u003e It is not intended to be used for machine-to-machine communication. (Keep using JSON or other file formats for that.\n\u003e 🙂)\n\n# Usage\n\nAdd the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\nfigment = \"0.10\"\nfigment-json5 = \"0.1.1\"\n```\n\n# License\n\n`figment-json5` is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\n\n[crates.io]: https://img.shields.io/crates/v/figment-json5.svg\n\n[crate]: https://crates.io/crates/figment-json5\n\n[docs.rs]: https://docs.rs/figment-json5/badge.svg\n\n[docs]: https://docs.rs/figment-json5\n\n[ci.svg]: https://github.com/powerumc/figment-json5/actions/workflows/ci.yml/badge.svg\n\n[ci]: https://github.com/powerumc/figment-json5/actions","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerumc%2Ffigment-json5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerumc%2Ffigment-json5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerumc%2Ffigment-json5/lists"}