This code can decompress a file in LZ2TreeFile format. Use it like so:
node index.js < input.cd3 > output.txt
It really needs to be rewritten as a stream transformer, and a corresponding compressor should be implemented so that files can be changed and recompressed.
GPL3