evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

Add watch option -w and run md2html whenever the watched source file changes #275

Open jeffschwartz opened 8 years ago

jeffschwartz commented 8 years ago

Reason: The npm package.json script object is becoming a defacto task runner (e.g. Angular2). So having the ability to run the markdown converter whenever a source markdown file changes will work with npm run <script-name>.

Example:

"scripts: {
    "start": "concurrently \"npm run md2html:w\" \"npm run lite\" ",
    "md2html:w": "md2html -w src/test.md > dest/test.html"
}

Currently I'd have to use gulp or grunt to do this as both support watch but coordinating what then amounts to 2 task managers (gulp/grunt && scripts) would be nearly impossible.

Bonus: Add the ability to watch multiple source folders/files using globs and output to target folders/files.