{"id":58499,"library":"ts-rs","title":"ts-rs","description":"generate typescript bindings from rust types","status":"active","version":"12.0.1","language":"rust","source_language":null,"source_url":"https://github.com/Aleph-Alpha/ts-rs","tags":["typescript","bindings","code-generation","serde"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nts-rs = \"12.0.1\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add ts-rs","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"TS","correct":"use ts_rs::TS;"}],"quickstart":{"code":"use ts_rs::TS;\n\n#[derive(TS)]\n#[ts(export)]\nstruct User {\n    name: String,\n    age: i32,\n}\n\nfn main() {\n    User::export().unwrap();\n}","lang":"rust","description":"Generate TypeScript bindings for a Rust struct"},"warnings":[{"fix":"Add `features = [\"export\"]` to the `ts-rs` dependency in Cargo.toml.","message":"Requires the `export` feature to write files; otherwise only generates strings.","severity":"gotcha","affected_versions":">=12.0.0"}],"env_vars":null,"search_vec":"'bind':6,11 'code':13 'code-gener':12 'generat':4,14 'rs':3 'rust':8 'serd':15 'ts':2 'ts-rs':1 'type':9 'typescript':5,10","created_at":"2026-06-16T16:26:01.515724+00:00","updated_at":"2026-06-16T16:26:01.515724+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Aleph-Alpha/ts-rs","github":"https://github.com/Aleph-Alpha/ts-rs","docs":"https://docs.rs/ts-rs/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}