Skip to content

Instantly share code, notes, and snippets.

@dyoder
Created November 19, 2014 20:13
Show Gist options
  • Save dyoder/5cf46e54505bfc781a3d to your computer and use it in GitHub Desktop.
Save dyoder/5cf46e54505bfc781a3d to your computer and use it in GitHub Desktop.
{readFile, writeFile} = require "fs"
marked = require "marked"
readFile "my-blog-post.md", (error, buffer) ->
unless error?
try
html = marked buffer.toString()
writeFile "my-blog-post.html", html, (error) ->
if error?
console.error error
catch error
console.error error
else
console.error error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment