     readSync: (filename) ->
         fs.readFileSync(filename)?.toString()
 
-    write: (dest, data, done) ->
+    write: (path, dest, data, done) ->
         unless dest?
             return done null
         # save json dom in an own file

fs = require 'fs'
mkdirp = require 'mkdirp'
jQuery = require 'jquery'
{ extname, dirname } = require 'path'
{ jsonify } = require './traverse'
link = require './linker'


        unless @extensions[ext]?
            return done new Error "file extension of #{dest} not supported."
        source = @extensions[ext](data)
        fullpath = pathjoin(path, dest)
        mkdirp dirname(fullpath), (err) ->
            return done err if err
            fs.writeFile(fullpath, source, done)

    parse: (data) ->
        @el = @$(data)
