packages, improve on formatBuf, add formatBuf to jsModeSaveHook