This demonstrates turndown – an HTML to Markdown converter in JavaScript.
var turndownService = new TurndownService()
console.log(
turndownService.turndown('<h1>Hello world</h1>')
)
It aims to be CommonMark compliant, and includes options to style the output. These options include: