S-expressions are better, and something that sees so much usage should have a dedicated format. In a saner world, this work would already be done so that each protocol needn't define the octets on the line. Regardless, IMAP already exists.
It's a diseased mind that takes a shitty programming language, JavaScript, and turns it into a shitty structured data format.