Data convert from html to Markdown by Node.js

In the local environment, convert each html file to a Markdown file and save it under a different name. Things necessary Prepare in the same directory. index.js directory: convert_from directory: convert_after directory: node_modules directory: convert_from Store the source html files here. directory: convert_after Here, the converted Markdown files will be generated. directory: node_modules The modules that require npm install are: turndown glob index.js const fs = require("node:fs"); const path = require('node:path'); const TurndownService = require('turndown'); const glob = require('glob'); const html2md = (html) => { const turndownService = new TurndownService({ headingStyle: "atx", bulletListMarker: "-", codeBlockStyle: "fenced", }); return turndownService....

April 18, 2022