---
# System prepended metadata

title: WASI-Virt Component Transformer

---

# WASI-Virt Component Transformer

```
package wasi:virt;

world transformer {
    record options {
        environment: list<(string, string)>,
        files: list<(string, string)>
        // other virt fields ...
    }
    
    export transform: func(
        component: list<u8>,
        options: options
    ) -> result<list<u8>>;
}
```

## Example `WAC`

Let's assume a component that targets the world `wasi:virt/transformer` that simply embeds the existing `WASI-Virt` library and exists as a resolvable package called `wasi:virt`...

```
let x = transform<wasi:virt> foo:bar {
    environment: [("FOO", "BAR")],
    files: [("/", "/foo")]
};
```