evilstreak / markdown-js

A Markdown parser for javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

jeffschwartz opened this issue · comments

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.