{"id":25814485,"url":"https://github.com/tarnadas/ninres-rs","last_synced_at":"2025-02-28T03:23:06.653Z","repository":{"id":40673292,"uuid":"259663189","full_name":"Tarnadas/ninres-rs","owner":"Tarnadas","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-06T05:27:13.000Z","size":11632,"stargazers_count":12,"open_issues_count":12,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-23T04:09:08.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tarnadas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-04-28T14:38:27.000Z","updated_at":"2024-08-08T19:36:29.000Z","dependencies_parsed_at":"2024-11-18T23:54:11.286Z","dependency_job_id":"d478dde3-c140-4a7f-90be-6602a1ee4195","html_url":"https://github.com/Tarnadas/ninres-rs","commit_stats":{"total_commits":81,"total_committers":2,"mean_commits":40.5,"dds":"0.012345679012345734","last_synced_commit":"2234bc2cabd86b93d491568363cf215171a356dc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarnadas%2Fninres-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarnadas%2Fninres-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarnadas%2Fninres-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarnadas%2Fninres-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tarnadas","download_url":"https://codeload.github.com/Tarnadas/ninres-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241079807,"owners_count":19906132,"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":[],"created_at":"2025-02-28T03:23:06.092Z","updated_at":"2025-02-28T03:23:06.617Z","avatar_url":"https://github.com/Tarnadas.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ninres-rs\n\n![Continuous integration](https://github.com/Tarnadas/ninres-rs/workflows/Continuous%20integration/badge.svg)\n[\u003cimg alt=\"blog.rust-lang.org\" src=\"https://img.shields.io/badge/Rust-1.53-blue?style=for-the-badge\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html)\n[![Discord](https://img.shields.io/discord/168893527357521920?label=Discord\u0026logo=discord\u0026color=7289da)](https://discord.gg/SPZsgSe)\n\nRead commonly used Nintendo file formats.\n\nPlease refer to the Wiki:\nhttps://github.com/Kinnay/Nintendo-File-Formats/wiki\n\nAll file formats are behind feature flags.\nHere is a list of available Nintendo file format features:\n\n`bfres`, `sarc`\n\nYou can also enable additional features:\n\n`tar`: write Nintendo resource to tar ball.\n\n`zstd`: ZSTD decompression.\n\n`png`: allows extracting textures as png.\n\nThe library is written in Rust and compiles to WebAssembly for the web or can be used as a standard Rust Crate.\nA live demo running in your browser can be found here:\nhttps://tarnadas.github.io/ninres-rs/\n\n### Examples\n\nEnable desired features in `Cargo.toml`.\n\n```toml\n[dependencies]\nninres = { version = \"*\", features = [\"bfres\", \"sarc\", \"zstd\"] }\n```\n\nIn your `main.rs`.\n\n```rust\nuse std::fs::read;\nuse ninres::{NinRes, NinResFile};\n\nlet buffer = read(\"foo.pack\")?;\nlet ninres = buffer.as_ninres()?;\n\nmatch \u0026ninres {\n    NinResFile::Bfres(_bfres) =\u003e {}\n    NinResFile::Sarc(_sarc) =\u003e {}\n}\n```\n\n## Write to tar\n\nConvert resource into tar buffer.\nThis buffer can then e.g. be stored in a file.\n\nThe `mode` parameter refers to the file mode within the tar ball.\n\n### Examples\n\n```rust\nuse ninres::{sarc::Sarc, IntoTar};\nuse std::{fs::{read, File}, io::Write};\n\nlet sarc_file = Sarc::new(\u0026read(\"./assets/M1_Model.pack\")?)?;\nlet tar = sarc_file.into_tar(0o644)?;\n\nlet mut file = File::create(\"M1_Model.tar\")?;\nfile.write_all(\u0026tar.into_inner()[..])?;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarnadas%2Fninres-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarnadas%2Fninres-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarnadas%2Fninres-rs/lists"}