A stream-based serializer for JSON.