aboutsummaryrefslogtreecommitdiff
path: root/js/bin/markdown
blob: 31b7ce48af3c0778c5f10350e8dadf823fb4db0a (plain)
  1. #!/usr/bin/env node
  2. var fs = require('fs');
  3. var util = require('util');
  4. var stmd = require('../lib/index.js');
  5. file = process.argv[2] || '/dev/stdin';
  6. fs.readFile(file, 'utf8', function(err, data) {
  7. if (err) {
  8. return console.log(err);
  9. }
  10. var parser = new stmd.DocParser();
  11. var renderer = new stmd.HtmlRenderer();
  12. process.stdout.write(renderer.render(parser.parse(data)));
  13. });