lib/index.js
function(file, done){
      process.nextTick(function () {
        terra.render(file, function(error, body){
          if(error){
            done(error);
          }else{
            if(body){
              var dest = path.resolve(outputPath, ssr.helpers.outputPath(file));
              fs.mkdirp(path.dirname(dest), function(err){
                fs.writeFile(dest, body, done);
              });
            }else{
              done();
            }
          }
        });
      });
    }
function(file, done){
      process.nextTick(function () {
        terra.render(file, function(error, body){
          if(error){
            done(error);
          }else{
            if(body){
              var dest = path.resolve(outputPath, ssr.helpers.outputPath(file));
              fs.mkdirp(path.dirname(dest), function(err){
                fs.writeFile(dest, body, done);
              });
            }else{
              done();
            }
          }
        });
      });
    }
function ( file , done ) { process . nextTick ( function ( ) { terra . render ( file , function ( error , body ) { if ( error ) { done ( error ) ; } else { if ( body ) { var dest = path . resolve ( outputPath , ssr . helpers . outputPath ( file ) ) ; fs . mkdirp ( path . dirname ( dest ) , function ( err ) { fs . writeFile ( dest , body , done ) ; } ) ; } else { done ( ) ; } } } ) ; } ) ; }
Compile and save file
Compile and save file