### Install unluac-cli from Source Source: https://docs.rs/crate/unluac Installs the unluac-cli package using Cargo from a local checkout. ```bash cargo install --path packages/unluac-cli ``` -------------------------------- ### npm Package Installation Source: https://docs.rs/crate/unluac Install the unluac-js npm package using npm. ```bash npm install unluac-js ``` -------------------------------- ### Minimal Rust Decompilation Example Source: https://docs.rs/crate/unluac Reads a compiled Lua chunk from a file, decompiles it using Lua 5.1 dialect, and prints the generated source. ```rust use std::fs; use unluac::decompile::{decompile, DecompileDialect, DecompileOptions, DecompileStage}; fn main() -> Result<(), Box> { let bytes = fs::read("sample.out")?; let result = decompile( &bytes, DecompileOptions { dialect: DecompileDialect::Lua51, target_stage: DecompileStage::Generate, ..DecompileOptions::default() }, )?; if let Some(generated) = result.state.generated.as_ref() { println!("{}", generated.source); } Ok(()) } ``` -------------------------------- ### Minimal Node.js Decompilation Example Source: https://docs.rs/crate/unluac Reads a compiled Lua chunk from a file using Node.js promises, decompiles it, and logs the resulting source code. ```javascript import { decompile } from "unluac-js"; import { readFile } from "node:fs/promises"; const chunkBytes = await readFile("./sample.luac"); const source = await decompile(chunkBytes, { dialect: "lua5.1", }); console.log(source); ``` -------------------------------- ### Run unluac-cli from Development Checkout Source: https://docs.rs/crate/unluac Executes the unluac-cli tool directly from the repository during development, showing its help message. ```bash cargo run -p unluac-cli -- --help ``` -------------------------------- ### Compile and Decompile Lua Source Source: https://docs.rs/crate/unluac Uses an external compiler to process a Lua source file into a chunk, then decompiles the generated chunk. Specifies the Lua dialect. ```bash unluac-cli -s tests/unit-case/lua51_01.lua -D lua5.1 ``` -------------------------------- ### Decompile Chunk to Output File Source: https://docs.rs/crate/unluac Decompiles a Lua chunk file and writes the generated Lua source to a specified output file. Includes the Lua dialect. ```bash unluac-cli -i /absolute/path/to/chunk.out -D lua5.1 -o /tmp/case.lua ``` -------------------------------- ### Decompile a Chunk to Standard Output Source: https://docs.rs/crate/unluac Decompiles a Lua chunk file and prints the generated Lua source to standard output. Specifies the Lua dialect. ```bash unluac-cli -i /absolute/path/to/chunk.out -D lua5.1 ``` -------------------------------- ### Rust Dependency: Git Main Branch Source: https://docs.rs/crate/unluac Use a git dependency in Cargo.toml to include the latest unreleased changes from the main branch. ```toml [dependencies] unluac = { git = "https://github.com/x3zvawq/unluac-rs" } ``` -------------------------------- ### Rust Dependency: Crates.io Source: https://docs.rs/crate/unluac Add the unluac crate to your Rust project's Cargo.toml for released builds. ```toml [dependencies] unluac = "1" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.