标签:efi read div node else down http mds watch
https://github.com/markdown-it/markdown-it
‘use strict‘; const md = require(‘markdown-it‘)(); const fs = require(‘fs‘); fs.watchFile(‘./txt/1.md‘, (curr, prev) => { let mdStr = fs.readFile(‘./txt/1.md‘, ‘utf-8‘, (err, data) => { let mdData = md.render(data); let htmlTemplate = fs.readFile(‘./txt/index.html‘, ‘utf-8‘, (err, data) => { let html = data.replace(‘{{content}}‘, mdData); console.log(mdData); fs.writeFile(‘./txt/nodejs.html‘, html, ‘utf-8‘, (err, data) => { if (err) { throw err; } else { console.log(‘OK‘); } }); }); }); });
标签:efi read div node else down http mds watch
原文地址:http://www.cnblogs.com/Lomio/p/6117238.html