rust-bundler

Creates a single-source-file version of a Cargo package.

Build status Coverage report Crates.io

Features

Example

Input: ```rust // src/lib.rs: mod internal; pub use internal::hello_world;

// src/internal.rs: pub fn hello_world() { println!("Hello, world!"); }

// src/main.rs: extern crate example; fn main() { example::hello_world(); } ```

Output: rust mod internal { pub fn hello_world() { println!("Hello, world!"); } } pub use internal::hello_world; fn main() { hello_world(); }

More examples in tests/testdata.

Usage

Install: sh $ cargo install bundler

Run: sh $ bundle path/to/project >output.rs

Library Usage

toml [dependencies] bundler = "0.1.1"

```rust extern crate bundler;

fn main() { let code = bundler::bundle("path/to/project"); println!("{}", code); } ```

Similar Projects