sourcepak is a Rust crate that provides support for working with VPK (Valve Pak) files. It allows you to read and write VPK files, as well as extract and pack their contents.
- Read and write VPK files
- Extract files from VPK archives
- Optionally memory-map archive files for faster speeds (with the
mem-map
feature) - Write VPK directory files (
dir.vpk
)
- Read directory files
- Read file contents
- Write VPK directories
- Read directory files
- Read file contents
- Write VPK directories
- Read directory files
- Read file contents
- Read audio files (see here for why this is separate)
- Write VPK directories
Documentation can be found here
I originally created the TFVPKTool TypeScript library to support reading Respawn VPK files, along with Harmony VPK Tool using Electron.
I very quickly noticed the issue that these often resulted in high memory use due to language and ecosystem I had used.
With sourcepak I am aiming to fix that.