# writeSource

Function

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/write.ts#L172

```ts
writeSource(writeSourceOptions: WriteSourceOptions, fs: FileSystem): Promise<void>
```

Write a [ChunkSource](https://api.playcanvas.com/splat-transform/interfaces/ChunkSource.md) to a file. Formats with a source writer
(`ply`, `sog`, `compressed-ply`, `splat`, `image`) consume the source
directly; the rest (`csv`, `spz`, `glb`, `html`, `voxel`) still take a
`DataTable`, so the source is materialized right here and the table stays
a private detail of those writers until each is ported.

`lod` output is written via `writeLodSource` (multi-LOD + env), not here.

Each writer is responsible for opening its own `Writing` log group and
emitting `filename (size)` info entries per output file.

**Parameters**

- `writeSourceOptions` ([`WriteSourceOptions`](https://api.playcanvas.com/splat-transform/types/WriteSourceOptions.md)): The source, format and options to write.
- `fs` (`FileSystem`): File system abstraction for writing files.

**Returns** `Promise<void>`
