# script-meditate [crates.io](https://crates.io/crates/script-meditate) Supercharge [Cargo scripts](https://doc.rust-lang.org/cargo/reference/unstable.html#script) with inline structured data/configuration. ## Example Place the following in a file and make it executable, so it can be used as a standalone script: ```rust #!/usr/bin/env -S cargo +nightly -Zscript ---cargo [package] edition = "2021" [dependencies] script-meditate = { version = "0.1.0", features = ["json"] } serde = { version = "1.0", features = ["derive"] } --- /*json { "test": 42 } */ fn main() { let value: Data = script_meditate::extract_json_frontmatter!(); dbg!(&value); assert_eq!(value.test, 42); } #[derive(Debug, serde::Deserialize)] struct Data { test: u8, } ``` ### Note The script must not be placed directly inside the user's home directory. ## License Copyright 2024 dmb-ish Dual-licensed under MIT OR Apache-2.0.