Serialize as NDJSON using Json.NET

As Json.NET does not currently have a built-in method to serialize a collection to NDJSON, the simplest answer would be to write to a single TextWriter using a separate JsonTextWriter for each line, setting CloseOutput = false for each: public static partial class JsonExtensions { public static void ToNewlineDelimitedJson<T>(Stream stream, IEnumerable<T> items) { // Let … Read more