How to print a mark file on the console using node.js?

I have README.md (markup syntax) that I want to print to the console using node.js.

Is it possible?

+5
source share
2 answers

Install markdown-js first (https://github.com/evilstreak/markdown-js)

$ npm install markdown-js

Then create javascript:

var markdown = require("markdown-js");
var fs = require("fs");

var str = fs.readFileSync("filename.md", "utf8");

var result = markdown.makeHtml(str);

console.log(result);
+17
source
npm i -g marky-markdown
marky-markdown input.md > output.html
cat output.html

npmjs displayed pages use a Maruku markdown. If you want to see how they will be displayed, use the npm marky-markdown package , as it is npmjs . Full description is available on the blog .

0
source

All Articles