Skip to main content
Build Real-time Applications with the new "watch" API in Deno KV
Read more
function Deno.formatDiagnostics

UNSTABLE: new API, yet to be vetted.

Format an array of diagnostic items and return them as a single string in a user friendly format. If there are no diagnostics then it will return an empty string.

const { diagnostics } = await Deno.emit("file_with_compile_issues.ts");
console.table(diagnostics);  // Prints raw diagnostic data
console.log(Deno.formatDiagnostics(diagnostics));  // User friendly output of diagnostics
console.log(Deno.formatDiagnostics([]));  // An empty string


diagnostics: Diagnostic[]

An array of diagnostic items to format