var transform = require("./transformation/transform");
var fs        = require("fs");
var _         = require("lodash");

exports.runtime = require("./runtime");

exports.register = function (opts) {
  var register = require("./register");
  if (opts != null) register(opts);
  return register;
};

exports.polyfill = function () {
  require("./polyfill");
};

exports.transform = transform;

exports.transformFile = function (filename, opts, callback) {
  if (_.isFunction(opts)) {
    callback = opts;
    opts = {};
  }

  opts.filename = filename;

  fs.readFile(filename, function (err, code) {
    if (err) return callback(err);

    var result;

    try {
      result = transform(code, opts);
    } catch (err) {
      return callback(err);
    }

    callback(null, result);
  });
};

exports.transformFileSync = function (filename, opts) {
  opts = opts || {};
  opts.filename = filename;
  return transform(fs.readFileSync(filename), opts);
};

@@ -44,24 +44,57 @@
 ransform%22);%0A
+var path      = require(%22path%22);%0A
 var fs      
@@ -383,24 +383,197 @@
 fill%22);%0A%7D;%0A%0A
+exports.canCompile = function (filename, altExts) %7B%0A  var exts = altExts %7C%7C %5B%22.js%22, %22.jsx%22, %22.es6%22%5D;%0A  var ext = path.extname(filename);%0A  return _.contains(exts, ext);%0A%7D;%0A%0A
 exports.tran

add canCompile method to node api