     @_render(str, opts)
 
   renderFile: (file, opts = {}) ->
-    @render(fs.readFileSync(file, 'utf8'), _.extend(opts, {filename: file}))
+    readFile(file).then _.partialRight(@render, _.extend(opts, {filename: file})).bind(@)
 
   compile: (str, opts = {}) ->
     if not @_compile

    @_compileClient(str, opts)

  compileFileClient: (file, opts = {}) ->
    @compileClient(
      fs.readFileSync(file, 'utf8'),
      _.extend(opts, {filename: file})
    )

module.exports = Adapter

fs        = require 'fs'
W         = require 'when'
_         = require 'lodash'
nodefn    = require 'when/node'
readFile  = _.partialRight(nodefn.lift(fs.readFile), 'utf8')

class Adapter
  render: (str, opts = {}) ->
