Skip to content

Instantly share code, notes, and snippets.

@chrismytton
Created March 4, 2011 01:38
Show Gist options
  • Select an option

  • Save chrismytton/854001 to your computer and use it in GitHub Desktop.

Select an option

Save chrismytton/854001 to your computer and use it in GitHub Desktop.
Stitch handlebars compiler
fs = require 'fs'
module.exports = (module, filename) ->
source = fs.readFileSync filename, 'utf8'
content = """
module.exports = Handlebars.compile(#{JSON.stringify source});
"""
module._compile content, filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment