diff --git a/lib/nodejs/test/binary.test.js b/lib/nodejs/test/binary.test.js
index 38ba634..187cd18 100644
--- a/lib/nodejs/test/binary.test.js
+++ b/lib/nodejs/test/binary.test.js
@@ -17,19 +17,19 @@
  * under the License.
  */
 
-var test = require('tape');
-var binary = require('thrift/binary');
+const test = require("tape");
+const binary = require("thrift/binary");
 
-var cases = {
-  "Should read signed byte": function(assert){
+const cases = {
+  "Should read signed byte": function(assert) {
     assert.equal(1, binary.readByte(0x01));
-    assert.equal(-1, binary.readByte(0xFF));
+    assert.equal(-1, binary.readByte(0xff));
 
-    assert.equal(127, binary.readByte(0x7F));
+    assert.equal(127, binary.readByte(0x7f));
     assert.equal(-128, binary.readByte(0x80));
     assert.end();
   },
-  "Should write byte": function(assert){
+  "Should write byte": function(assert) {
     //Protocol simply writes to the buffer. Nothing to test.. yet.
     assert.ok(true);
     assert.end();
@@ -76,58 +76,135 @@
     assert.deepEqual([0xff, 0xff, 0xff, 0xff], binary.writeI32([], -1));
 
     // Min I32
-    assert.deepEqual([0x80, 0x00, 0x00, 0x00], binary.writeI32([], -2147483648));
+    assert.deepEqual(
+      [0x80, 0x00, 0x00, 0x00],
+      binary.writeI32([], -2147483648)
+    );
     // Max I32
     assert.deepEqual([0x7f, 0xff, 0xff, 0xff], binary.writeI32([], 2147483647));
     assert.end();
   },
 
   "Should read doubles": function(assert) {
-    assert.equal(0, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
-    assert.equal(0, binary.readDouble([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
-    assert.equal(1, binary.readDouble([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
-    assert.equal(2, binary.readDouble([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
-    assert.equal(-2, binary.readDouble([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
+    assert.equal(
+      0,
+      binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
+    assert.equal(
+      0,
+      binary.readDouble([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
+    assert.equal(
+      1,
+      binary.readDouble([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
+    assert.equal(
+      2,
+      binary.readDouble([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
+    assert.equal(
+      -2,
+      binary.readDouble([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
 
-    assert.equal(Math.PI, binary.readDouble([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18]))
+    assert.equal(
+      Math.PI,
+      binary.readDouble([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18])
+    );
 
-    assert.equal(Infinity, binary.readDouble([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
-    assert.equal(-Infinity, binary.readDouble([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
+    assert.equal(
+      Infinity,
+      binary.readDouble([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
+    assert.equal(
+      -Infinity,
+      binary.readDouble([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
 
-    assert.ok(isNaN(binary.readDouble([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])))
+    assert.ok(
+      isNaN(binary.readDouble([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
+    );
 
-    assert.equal(1/3, binary.readDouble([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55]))
+    assert.equal(
+      1 / 3,
+      binary.readDouble([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55])
+    );
 
     // Min subnormal positive double
-    assert.equal(4.9406564584124654e-324, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]))
+    assert.equal(
+      4.9406564584124654e-324,
+      binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])
+    );
     // Min normal positive double
-    assert.equal(2.2250738585072014e-308, binary.readDouble([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
+    assert.equal(
+      2.2250738585072014e-308,
+      binary.readDouble([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+    );
     // Max positive double
-    assert.equal(1.7976931348623157e308, binary.readDouble([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]))
+    assert.equal(
+      1.7976931348623157e308,
+      binary.readDouble([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])
+    );
     assert.end();
   },
 
   "Should write doubles": function(assert) {
-    assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 0));
-    assert.deepEqual([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 1));
-    assert.deepEqual([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2));
-    assert.deepEqual([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -2));
+    assert.deepEqual(
+      [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], 0)
+    );
+    assert.deepEqual(
+      [0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], 1)
+    );
+    assert.deepEqual(
+      [0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], 2)
+    );
+    assert.deepEqual(
+      [0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], -2)
+    );
 
-    assert.deepEqual([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18], binary.writeDouble([], Math.PI));
+    assert.deepEqual(
+      [0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18],
+      binary.writeDouble([], Math.PI)
+    );
 
-    assert.deepEqual([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], Infinity));
-    assert.deepEqual([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -Infinity));
+    assert.deepEqual(
+      [0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], Infinity)
+    );
+    assert.deepEqual(
+      [0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], -Infinity)
+    );
 
-    assert.deepEqual([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], NaN));
+    assert.deepEqual(
+      [0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], NaN)
+    );
 
-    assert.deepEqual([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55], binary.writeDouble([], 1/3));
+    assert.deepEqual(
+      [0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55],
+      binary.writeDouble([], 1 / 3)
+    );
 
     // Min subnormal positive double
-    assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], binary.writeDouble([], 4.9406564584124654e-324));
+    assert.deepEqual(
+      [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
+      binary.writeDouble([], 4.9406564584124654e-324)
+    );
     // Min normal positive double
-    assert.deepEqual([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2.2250738585072014e-308));
+    assert.deepEqual(
+      [0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
+      binary.writeDouble([], 2.2250738585072014e-308)
+    );
     // Max positive double
-    assert.deepEqual([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], binary.writeDouble([], 1.7976931348623157e308));
+    assert.deepEqual(
+      [0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff],
+      binary.writeDouble([], 1.7976931348623157e308)
+    );
     assert.end();
   }
 };
diff --git a/lib/nodejs/test/client.js b/lib/nodejs/test/client.js
index 55839f6..49e3a5e 100644
--- a/lib/nodejs/test/client.js
+++ b/lib/nodejs/test/client.js
@@ -19,125 +19,149 @@
  * under the License.
  */
 
-var fs = require('fs');
-var assert = require('assert');
-var thrift = require('thrift');
-var helpers = require('./helpers');
-var ThriftTest = require('./gen-nodejs/ThriftTest');
-var ThriftTestDriver = require('./test_driver').ThriftTestDriver;
-var ThriftTestDriverPromise = require('./test_driver').ThriftTestDriverPromise;
-var SecondService = require('./gen-nodejs/SecondService');
-var ttypes = require('./gen-nodejs/ThriftTest_types');
+const assert = require("assert");
+const thrift = require("thrift");
+const helpers = require("./helpers");
 
-var program = require('commander');
+const ThriftTest = require(`./${helpers.genPath}/ThriftTest`);
+const ThriftTestDriver = require("./test_driver").ThriftTestDriver;
+const ThriftTestDriverPromise = require("./test_driver")
+  .ThriftTestDriverPromise;
+const SecondService = require(`./${helpers.genPath}/SecondService`);
+
+const program = require("commander");
 
 program
-  .option('-p, --protocol <protocol>', 'Set thrift protocol (binary|compact|json) [protocol]')
-  .option('-t, --transport <transport>', 'Set thrift transport (buffered|framed|http) [transport]')
-  .option('--port <port>', 'Set thrift server port number to connect', 9090)
-  .option('--host <host>', 'Set thrift server host to connect', 'localhost')
-  .option('--domain-socket <path>', 'Set thrift server unix domain socket to connect')
-  .option('--ssl', 'use SSL transport')
-  .option('--promise', 'test with promise style functions')
-  .option('-t, --type <type>', 'Select server type (http|multiplex|tcp|websocket)', 'tcp')
+  .option(
+    "-p, --protocol <protocol>",
+    "Set thrift protocol (binary|compact|json) [protocol]"
+  )
+  .option(
+    "-t, --transport <transport>",
+    "Set thrift transport (buffered|framed|http) [transport]"
+  )
+  .option("--port <port>", "Set thrift server port number to connect", 9090)
+  .option("--host <host>", "Set thrift server host to connect", "localhost")
+  .option(
+    "--domain-socket <path>",
+    "Set thrift server unix domain socket to connect"
+  )
+  .option("--ssl", "use SSL transport")
+  .option("--callback", "test with callback style functions")
+  .option(
+    "-t, --type <type>",
+    "Select server type (http|multiplex|tcp|websocket)",
+    "tcp"
+  )
+  .option("--es6", "Use es6 code")
+  .option("--es5", "Use es5 code")
   .parse(process.argv);
 
-var host = program.host;
-var port = program.port;
-var domainSocket = program.domainSocket;
-var type = program.type;
-var ssl = program.ssl;
-var promise = program.promise;
+const host = program.host;
+const port = program.port;
+const domainSocket = program.domainSocket;
+const ssl = program.ssl;
+let type = program.type;
 
 /* for compatibility with cross test invocation for http transport testing */
-if (program.transport === 'http') {
-  program.transport = 'buffered';
-  type = 'http';
+if (program.transport === "http") {
+  program.transport = "buffered";
+  type = "http";
 }
 
-var options = {
+const options = {
   transport: helpers.transports[program.transport],
   protocol: helpers.protocols[program.protocol]
 };
 
-if (type === 'http' || type === 'websocket') {
-  options.path = '/test';
+if (type === "http" || type === "websocket") {
+  options.path = "/test";
 }
 
-if (type === 'http') {
-  options.headers = {"Connection": "close"};
+if (type === "http") {
+  options.headers = { Connection: "close" };
 }
 
 if (ssl) {
-  if (type === 'tcp' || type === 'multiplex') {
+  if (type === "tcp" || type === "multiplex") {
     options.rejectUnauthorized = false;
-  } else if (type === 'http') {
+  } else if (type === "http") {
     options.nodeOptions = { rejectUnauthorized: false };
     options.https = true;
-  } else if (type === 'websocket') {
+  } else if (type === "websocket") {
     options.wsOptions = { rejectUnauthorized: false };
     options.secure = true;
   }
 }
 
-var connection;
-var client;
-var testDriver = promise ? ThriftTestDriverPromise : ThriftTestDriver;
+let connection;
+let client;
+const testDriver = program.callback
+  ? ThriftTestDriver
+  : ThriftTestDriverPromise;
+if (helpers.ecmaMode === "es6" && program.callback) {
+  console.log("ES6 does not support callback style");
+  process.exit(0);
+}
 
-if (type === 'tcp' || type === 'multiplex') {
+if (type === "tcp" || type === "multiplex") {
   if (domainSocket) {
     connection = thrift.createUDSConnection(domainSocket, options);
   } else {
-    connection = ssl ?
-      thrift.createSSLConnection(host, port, options) :
-      thrift.createConnection(host, port, options);
+    connection = ssl
+      ? thrift.createSSLConnection(host, port, options)
+      : thrift.createConnection(host, port, options);
   }
-} else if (type === 'http') {
+} else if (type === "http") {
   if (domainSocket) {
     connection = thrift.createHttpUDSConnection(domainSocket, options);
   } else {
     connection = thrift.createHttpConnection(host, port, options);
   }
-} else if (type === 'websocket') {
+} else if (type === "websocket") {
   connection = thrift.createWSConnection(host, port, options);
   connection.open();
 }
 
-connection.on('error', function(err) {
-    assert(false, err);
+connection.on("error", function(err) {
+  assert(false, err);
 });
 
-if (type === 'tcp') {
+if (type === "tcp") {
   client = thrift.createClient(ThriftTest, connection);
   runTests();
-} else if (type === 'multiplex') {
-  var mp = new thrift.Multiplexer();
+} else if (type === "multiplex") {
+  const mp = new thrift.Multiplexer();
   client = mp.createClient("ThriftTest", ThriftTest, connection);
-  secondclient = mp.createClient("SecondService", SecondService, connection);
+  const secondclient = mp.createClient(
+    "SecondService",
+    SecondService,
+    connection
+  );
 
-  connection.on('connect', function() {
+  connection.on("connect", function() {
     secondclient.secondtestString("Test", function(err, response) {
       assert(!err);
-      assert.equal("testString(\"Test\")", response);
+      assert.equal('testString("Test")', response);
     });
 
     runTests();
   });
-} else if (type === 'http') {
+} else if (type === "http") {
   client = thrift.createHttpClient(ThriftTest, connection);
   runTests();
-} else if (type === 'websocket') {
+} else if (type === "websocket") {
   client = thrift.createWSClient(ThriftTest, connection);
   runTests();
 }
 
 function runTests() {
-  testDriver(client, function (status) {
+  testDriver(client, function(status) {
     console.log(status);
-    if (type !== 'http' && type !== 'websocket') {
+    if (type !== "http" && type !== "websocket") {
       connection.end();
     }
-    if (type !== 'multiplex') {
+    if (type !== "multiplex") {
       process.exit(0);
     }
   });
diff --git a/lib/nodejs/test/deep-constructor.test.js b/lib/nodejs/test/deep-constructor.test.js
index 145b668..504dacf 100644
--- a/lib/nodejs/test/deep-constructor.test.js
+++ b/lib/nodejs/test/deep-constructor.test.js
@@ -17,39 +17,36 @@
  * under the License.
  */
 
-var ttypes = require('./gen-nodejs/JsDeepConstructorTest_types');
-var thrift = require('thrift');
-var test = require('tape');
-var bufferEquals = require('buffer-equals');
+const ttypes = require("./gen-nodejs/JsDeepConstructorTest_types");
+const thrift = require("thrift");
+const test = require("tape");
+const bufferEquals = require("buffer-equals");
 
 function serializeBinary(data) {
-  var buff;
-  var transport = new thrift.TBufferedTransport(null, function(msg){
+  let buff;
+  const transport = new thrift.TBufferedTransport(null, function(msg) {
     buff = msg;
   });
-  var prot = new thrift.TBinaryProtocol(transport);
+  const prot = new thrift.TBinaryProtocol(transport);
   data.write(prot);
   prot.flush();
   return buff;
-
 }
 
-
 function deserializeBinary(serialized, type) {
-  var t = new thrift.TFramedTransport(serialized);
-  var p = new thrift.TBinaryProtocol(t);
-  var data = new type();
+  const t = new thrift.TFramedTransport(serialized);
+  const p = new thrift.TBinaryProtocol(t);
+  const data = new type();
   data.read(p);
   return data;
 }
 
-
 function serializeJSON(data) {
-  var buff;
-  var transport = new thrift.TBufferedTransport(null, function(msg){
+  let buff;
+  const transport = new thrift.TBufferedTransport(null, function(msg) {
     buff = msg;
   });
-  var protocol  = new thrift.TJSONProtocol(transport);
+  const protocol = new thrift.TJSONProtocol(transport);
   protocol.writeMessageBegin("", 0, 0);
   data.write(protocol);
   protocol.writeMessageEnd();
@@ -57,45 +54,41 @@
   return buff;
 }
 
-
 function deserializeJSON(serialized, type) {
-  var transport = new thrift.TFramedTransport(serialized);
-  var protocol  = new thrift.TJSONProtocol(transport);
+  const transport = new thrift.TFramedTransport(serialized);
+  const protocol = new thrift.TJSONProtocol(transport);
   protocol.readMessageBegin();
-  var data = new type();
+  const data = new type();
   data.read(protocol);
   protocol.readMessageEnd();
   return data;
 }
 
-
 function createThriftObj() {
-
   return new ttypes.Complex({
-
-    struct_field: new ttypes.Simple({value: 'a'}),
+    struct_field: new ttypes.Simple({ value: "a" }),
 
     struct_list_field: [
-      new ttypes.Simple({value: 'b'}),
-      new ttypes.Simple({value: 'c'}),
+      new ttypes.Simple({ value: "b" }),
+      new ttypes.Simple({ value: "c" })
     ],
 
     struct_set_field: [
-      new ttypes.Simple({value: 'd'}),
-      new ttypes.Simple({value: 'e'}),
+      new ttypes.Simple({ value: "d" }),
+      new ttypes.Simple({ value: "e" })
     ],
 
     struct_map_field: {
-      A: new ttypes.Simple({value: 'f'}),
-      B: new ttypes.Simple({value: 'g'})
+      A: new ttypes.Simple({ value: "f" }),
+      B: new ttypes.Simple({ value: "g" })
     },
 
     struct_nested_containers_field: [
       [
         {
           C: [
-            new ttypes.Simple({value: 'h'}),
-            new ttypes.Simple({value: 'i'})
+            new ttypes.Simple({ value: "h" }),
+            new ttypes.Simple({ value: "i" })
           ]
         }
       ]
@@ -104,59 +97,57 @@
     struct_nested_containers_field2: {
       D: [
         {
-          DA: new ttypes.Simple({value: 'j'})
+          DA: new ttypes.Simple({ value: "j" })
         },
         {
-          DB: new ttypes.Simple({value: 'k'})
+          DB: new ttypes.Simple({ value: "k" })
         }
       ]
     },
 
     list_of_list_field: [
-      ['l00', 'l01', 'l02'],
-      ['l10', 'l11', 'l12'],
-      ['l20', 'l21', 'l22'],
+      ["l00", "l01", "l02"],
+      ["l10", "l11", "l12"],
+      ["l20", "l21", "l22"]
     ],
 
     list_of_list_of_list_field: [
-      [['m000', 'm001', 'm002'], ['m010', 'm011', 'm012'], ['m020', 'm021', 'm022']],
-      [['m100', 'm101', 'm102'], ['m110', 'm111', 'm112'], ['m120', 'm121', 'm122']],
-      [['m200', 'm201', 'm202'], ['m210', 'm211', 'm212'], ['m220', 'm221', 'm222']],
-    ],
-
-
+      [
+        ["m000", "m001", "m002"],
+        ["m010", "m011", "m012"],
+        ["m020", "m021", "m022"]
+      ],
+      [
+        ["m100", "m101", "m102"],
+        ["m110", "m111", "m112"],
+        ["m120", "m121", "m122"]
+      ],
+      [
+        ["m200", "m201", "m202"],
+        ["m210", "m211", "m212"],
+        ["m220", "m221", "m222"]
+      ]
+    ]
   });
 }
 
-
 function createJsObj() {
-
   return {
+    struct_field: { value: "a" },
 
-    struct_field: {value: 'a'},
+    struct_list_field: [{ value: "b" }, { value: "c" }],
 
-    struct_list_field: [
-      {value: 'b'},
-      {value: 'c'},
-    ],
-
-    struct_set_field: [
-      {value: 'd'},
-      {value: 'e'},
-    ],
+    struct_set_field: [{ value: "d" }, { value: "e" }],
 
     struct_map_field: {
-      A: {value: 'f'},
-      B: {value: 'g'}
+      A: { value: "f" },
+      B: { value: "g" }
     },
 
     struct_nested_containers_field: [
       [
         {
-          C: [
-            {value: 'h'},
-            {value: 'i'}
-          ]
+          C: [{ value: "h" }, { value: "i" }]
         }
       ]
     ],
@@ -164,131 +155,142 @@
     struct_nested_containers_field2: {
       D: [
         {
-          DA: {value: 'j'}
+          DA: { value: "j" }
         },
         {
-          DB: {value: 'k'}
+          DB: { value: "k" }
         }
       ]
     },
 
     list_of_list_field: [
-      ['l00', 'l01', 'l02'],
-      ['l10', 'l11', 'l12'],
-      ['l20', 'l21', 'l22'],
+      ["l00", "l01", "l02"],
+      ["l10", "l11", "l12"],
+      ["l20", "l21", "l22"]
     ],
 
     list_of_list_of_list_field: [
-      [['m000', 'm001', 'm002'], ['m010', 'm011', 'm012'], ['m020', 'm021', 'm022']],
-      [['m100', 'm101', 'm102'], ['m110', 'm111', 'm112'], ['m120', 'm121', 'm122']],
-      [['m200', 'm201', 'm202'], ['m210', 'm211', 'm212'], ['m220', 'm221', 'm222']],
-    ],
-
+      [
+        ["m000", "m001", "m002"],
+        ["m010", "m011", "m012"],
+        ["m020", "m021", "m022"]
+      ],
+      [
+        ["m100", "m101", "m102"],
+        ["m110", "m111", "m112"],
+        ["m120", "m121", "m122"]
+      ],
+      [
+        ["m200", "m201", "m202"],
+        ["m210", "m211", "m212"],
+        ["m220", "m221", "m222"]
+      ]
+    ]
   };
 }
 
-
 function assertValues(obj, assert) {
-    assert.equals(obj.struct_field.value, 'a');
-    assert.equals(obj.struct_list_field[0].value, 'b');
-    assert.equals(obj.struct_list_field[1].value, 'c');
-    assert.equals(obj.struct_set_field[0].value, 'd');
-    assert.equals(obj.struct_set_field[1].value, 'e');
-    assert.equals(obj.struct_map_field.A.value, 'f');
-    assert.equals(obj.struct_map_field.B.value, 'g');
-    assert.equals(obj.struct_nested_containers_field[0][0].C[0].value, 'h');
-    assert.equals(obj.struct_nested_containers_field[0][0].C[1].value, 'i');
-    assert.equals(obj.struct_nested_containers_field2.D[0].DA.value, 'j');
-    assert.equals(obj.struct_nested_containers_field2.D[1].DB.value, 'k');
-    assert.equals(obj.list_of_list_field[0][0], 'l00');
-    assert.equals(obj.list_of_list_field[0][1], 'l01');
-    assert.equals(obj.list_of_list_field[0][2], 'l02');
-    assert.equals(obj.list_of_list_field[1][0], 'l10');
-    assert.equals(obj.list_of_list_field[1][1], 'l11');
-    assert.equals(obj.list_of_list_field[1][2], 'l12');
-    assert.equals(obj.list_of_list_field[2][0], 'l20');
-    assert.equals(obj.list_of_list_field[2][1], 'l21');
-    assert.equals(obj.list_of_list_field[2][2], 'l22');
+  assert.equals(obj.struct_field.value, "a");
+  assert.equals(obj.struct_list_field[0].value, "b");
+  assert.equals(obj.struct_list_field[1].value, "c");
+  assert.equals(obj.struct_set_field[0].value, "d");
+  assert.equals(obj.struct_set_field[1].value, "e");
+  assert.equals(obj.struct_map_field.A.value, "f");
+  assert.equals(obj.struct_map_field.B.value, "g");
+  assert.equals(obj.struct_nested_containers_field[0][0].C[0].value, "h");
+  assert.equals(obj.struct_nested_containers_field[0][0].C[1].value, "i");
+  assert.equals(obj.struct_nested_containers_field2.D[0].DA.value, "j");
+  assert.equals(obj.struct_nested_containers_field2.D[1].DB.value, "k");
+  assert.equals(obj.list_of_list_field[0][0], "l00");
+  assert.equals(obj.list_of_list_field[0][1], "l01");
+  assert.equals(obj.list_of_list_field[0][2], "l02");
+  assert.equals(obj.list_of_list_field[1][0], "l10");
+  assert.equals(obj.list_of_list_field[1][1], "l11");
+  assert.equals(obj.list_of_list_field[1][2], "l12");
+  assert.equals(obj.list_of_list_field[2][0], "l20");
+  assert.equals(obj.list_of_list_field[2][1], "l21");
+  assert.equals(obj.list_of_list_field[2][2], "l22");
 
-    assert.equals(obj.list_of_list_of_list_field[0][0][0], 'm000');
-    assert.equals(obj.list_of_list_of_list_field[0][0][1], 'm001');
-    assert.equals(obj.list_of_list_of_list_field[0][0][2], 'm002');
-    assert.equals(obj.list_of_list_of_list_field[0][1][0], 'm010');
-    assert.equals(obj.list_of_list_of_list_field[0][1][1], 'm011');
-    assert.equals(obj.list_of_list_of_list_field[0][1][2], 'm012');
-    assert.equals(obj.list_of_list_of_list_field[0][2][0], 'm020');
-    assert.equals(obj.list_of_list_of_list_field[0][2][1], 'm021');
-    assert.equals(obj.list_of_list_of_list_field[0][2][2], 'm022');
+  assert.equals(obj.list_of_list_of_list_field[0][0][0], "m000");
+  assert.equals(obj.list_of_list_of_list_field[0][0][1], "m001");
+  assert.equals(obj.list_of_list_of_list_field[0][0][2], "m002");
+  assert.equals(obj.list_of_list_of_list_field[0][1][0], "m010");
+  assert.equals(obj.list_of_list_of_list_field[0][1][1], "m011");
+  assert.equals(obj.list_of_list_of_list_field[0][1][2], "m012");
+  assert.equals(obj.list_of_list_of_list_field[0][2][0], "m020");
+  assert.equals(obj.list_of_list_of_list_field[0][2][1], "m021");
+  assert.equals(obj.list_of_list_of_list_field[0][2][2], "m022");
 
-    assert.equals(obj.list_of_list_of_list_field[1][0][0], 'm100');
-    assert.equals(obj.list_of_list_of_list_field[1][0][1], 'm101');
-    assert.equals(obj.list_of_list_of_list_field[1][0][2], 'm102');
-    assert.equals(obj.list_of_list_of_list_field[1][1][0], 'm110');
-    assert.equals(obj.list_of_list_of_list_field[1][1][1], 'm111');
-    assert.equals(obj.list_of_list_of_list_field[1][1][2], 'm112');
-    assert.equals(obj.list_of_list_of_list_field[1][2][0], 'm120');
-    assert.equals(obj.list_of_list_of_list_field[1][2][1], 'm121');
-    assert.equals(obj.list_of_list_of_list_field[1][2][2], 'm122');
+  assert.equals(obj.list_of_list_of_list_field[1][0][0], "m100");
+  assert.equals(obj.list_of_list_of_list_field[1][0][1], "m101");
+  assert.equals(obj.list_of_list_of_list_field[1][0][2], "m102");
+  assert.equals(obj.list_of_list_of_list_field[1][1][0], "m110");
+  assert.equals(obj.list_of_list_of_list_field[1][1][1], "m111");
+  assert.equals(obj.list_of_list_of_list_field[1][1][2], "m112");
+  assert.equals(obj.list_of_list_of_list_field[1][2][0], "m120");
+  assert.equals(obj.list_of_list_of_list_field[1][2][1], "m121");
+  assert.equals(obj.list_of_list_of_list_field[1][2][2], "m122");
 
-    assert.equals(obj.list_of_list_of_list_field[2][0][0], 'm200');
-    assert.equals(obj.list_of_list_of_list_field[2][0][1], 'm201');
-    assert.equals(obj.list_of_list_of_list_field[2][0][2], 'm202');
-    assert.equals(obj.list_of_list_of_list_field[2][1][0], 'm210');
-    assert.equals(obj.list_of_list_of_list_field[2][1][1], 'm211');
-    assert.equals(obj.list_of_list_of_list_field[2][1][2], 'm212');
-    assert.equals(obj.list_of_list_of_list_field[2][2][0], 'm220');
-    assert.equals(obj.list_of_list_of_list_field[2][2][1], 'm221');
-    assert.equals(obj.list_of_list_of_list_field[2][2][2], 'm222');
+  assert.equals(obj.list_of_list_of_list_field[2][0][0], "m200");
+  assert.equals(obj.list_of_list_of_list_field[2][0][1], "m201");
+  assert.equals(obj.list_of_list_of_list_field[2][0][2], "m202");
+  assert.equals(obj.list_of_list_of_list_field[2][1][0], "m210");
+  assert.equals(obj.list_of_list_of_list_field[2][1][1], "m211");
+  assert.equals(obj.list_of_list_of_list_field[2][1][2], "m212");
+  assert.equals(obj.list_of_list_of_list_field[2][2][0], "m220");
+  assert.equals(obj.list_of_list_of_list_field[2][2][1], "m221");
+  assert.equals(obj.list_of_list_of_list_field[2][2][2], "m222");
 }
 
 function createTestCases(serialize, deserialize) {
-
-  var cases = {
-
-    "Serialize/deserialize should return equal object": function(assert){
-      var tObj = createThriftObj();
-      var received = deserialize(serialize(tObj), ttypes.Complex);
-      assert.ok(tObj !== received, 'not the same object');
+  const cases = {
+    "Serialize/deserialize should return equal object": function(assert) {
+      const tObj = createThriftObj();
+      const received = deserialize(serialize(tObj), ttypes.Complex);
+      assert.ok(tObj !== received, "not the same object");
       assert.deepEqual(tObj, received);
       assert.end();
     },
 
-    "Nested structs and containers initialized from plain js objects should serialize same as if initialized from thrift objects": function(assert) {
-      var tObj1 = createThriftObj();
-      var tObj2 = new ttypes.Complex(createJsObj());
+    "Nested structs and containers initialized from plain js objects should serialize same as if initialized from thrift objects": function(
+      assert
+    ) {
+      const tObj1 = createThriftObj();
+      const tObj2 = new ttypes.Complex(createJsObj());
       assertValues(tObj2, assert);
-      var s1 = serialize(tObj1);
-      var s2 = serialize(tObj2);
+      const s1 = serialize(tObj1);
+      const s2 = serialize(tObj2);
       assert.ok(bufferEquals(s1, s2));
       assert.end();
     },
 
-    "Modifications to args object should not affect constructed Thrift object": function (assert) {
-
-      var args = createJsObj();
+    "Modifications to args object should not affect constructed Thrift object": function(
+      assert
+    ) {
+      const args = createJsObj();
       assertValues(args, assert);
 
-      var tObj = new ttypes.Complex(args);
+      const tObj = new ttypes.Complex(args);
       assertValues(tObj, assert);
 
-      args.struct_field.value = 'ZZZ';
-      args.struct_list_field[0].value = 'ZZZ';
-      args.struct_list_field[1].value = 'ZZZ';
-      args.struct_set_field[0].value = 'ZZZ';
-      args.struct_set_field[1].value = 'ZZZ';
-      args.struct_map_field.A.value = 'ZZZ';
-      args.struct_map_field.B.value = 'ZZZ';
-      args.struct_nested_containers_field[0][0].C[0] = 'ZZZ';
-      args.struct_nested_containers_field[0][0].C[1] = 'ZZZ';
-      args.struct_nested_containers_field2.D[0].DA = 'ZZZ';
-      args.struct_nested_containers_field2.D[0].DB = 'ZZZ';
+      args.struct_field.value = "ZZZ";
+      args.struct_list_field[0].value = "ZZZ";
+      args.struct_list_field[1].value = "ZZZ";
+      args.struct_set_field[0].value = "ZZZ";
+      args.struct_set_field[1].value = "ZZZ";
+      args.struct_map_field.A.value = "ZZZ";
+      args.struct_map_field.B.value = "ZZZ";
+      args.struct_nested_containers_field[0][0].C[0] = "ZZZ";
+      args.struct_nested_containers_field[0][0].C[1] = "ZZZ";
+      args.struct_nested_containers_field2.D[0].DA = "ZZZ";
+      args.struct_nested_containers_field2.D[0].DB = "ZZZ";
 
       assertValues(tObj, assert);
       assert.end();
     },
 
     "nulls are ok": function(assert) {
-      var tObj = new ttypes.Complex({
+      const tObj = new ttypes.Complex({
         struct_field: null,
         struct_list_field: null,
         struct_set_field: null,
@@ -296,7 +298,7 @@
         struct_nested_containers_field: null,
         struct_nested_containers_field2: null
       });
-      var received = deserialize(serialize(tObj), ttypes.Complex);
+      const received = deserialize(serialize(tObj), ttypes.Complex);
       assert.strictEqual(tObj.struct_field, null);
       assert.ok(tObj !== received);
       assert.deepEqual(tObj, received);
@@ -304,11 +306,11 @@
     },
 
     "Can make list with objects": function(assert) {
-      var tObj = new ttypes.ComplexList({
-        "struct_list_field": [new ttypes.Complex({})]
+      const tObj = new ttypes.ComplexList({
+        struct_list_field: [new ttypes.Complex({})]
       });
-      var innerObj = tObj.struct_list_field[0];
-      assert.ok(innerObj instanceof ttypes.Complex)
+      const innerObj = tObj.struct_list_field[0];
+      assert.ok(innerObj instanceof ttypes.Complex);
       assert.strictEqual(innerObj.struct_field, null);
       assert.strictEqual(innerObj.struct_list_field, null);
       assert.strictEqual(innerObj.struct_set_field, null);
@@ -317,17 +319,15 @@
       assert.strictEqual(innerObj.struct_nested_containers_field2, null);
       assert.end();
     }
-
   };
   return cases;
 }
 
-
-function run(name, cases){
+function run(name, cases) {
   Object.keys(cases).forEach(function(caseName) {
-    test(name + ': ' + caseName, cases[caseName]);
+    test(name + ": " + caseName, cases[caseName]);
   });
 }
 
-run('binary', createTestCases(serializeBinary, deserializeBinary));
-run('json', createTestCases(serializeJSON, deserializeJSON));
+run("binary", createTestCases(serializeBinary, deserializeBinary));
+run("json", createTestCases(serializeJSON, deserializeJSON));
diff --git a/lib/nodejs/test/exceptions.js b/lib/nodejs/test/exceptions.js
index afb3f67..ab2798a 100644
--- a/lib/nodejs/test/exceptions.js
+++ b/lib/nodejs/test/exceptions.js
@@ -17,72 +17,130 @@
  * under the License.
  */
 
-'use strict';
-var test = require('tape');
-var thrift = require('../lib/thrift/thrift.js');
-var InputBufferUnderrunError = require('../lib/thrift/input_buffer_underrun_error');
+"use strict";
+const test = require("tape");
+const thrift = require("../lib/thrift/thrift.js");
+const InputBufferUnderrunError = require("../lib/thrift/input_buffer_underrun_error");
 
-test('TApplicationException', function t(assert) {
-  var e = new thrift.TApplicationException(1, 'foo');
-  assert.ok(e instanceof thrift.TApplicationException, 'is instanceof TApplicationException');
-  assert.ok(e instanceof thrift.TException, 'is instanceof TException');
-  assert.ok(e instanceof Error, 'is instanceof Error');
-  assert.equal(typeof e.stack, 'string', 'has stack trace');
-  assert.ok(/^TApplicationException: foo/.test(e.stack), 'Stack trace has correct error name and message');
-  assert.ok(e.stack.indexOf('test/exceptions.js:7:11') !== -1, 'stack trace starts on correct line and column');
-  assert.equal(e.name, 'TApplicationException', 'has function name TApplicationException');
-  assert.equal(e.message, 'foo', 'has error message "foo"');
-  assert.equal(e.type, 1, 'has type 1');
+test("TApplicationException", function t(assert) {
+  const e = new thrift.TApplicationException(1, "foo");
+  assert.ok(
+    e instanceof thrift.TApplicationException,
+    "is instanceof TApplicationException"
+  );
+  assert.ok(e instanceof thrift.TException, "is instanceof TException");
+  assert.ok(e instanceof Error, "is instanceof Error");
+  assert.equal(typeof e.stack, "string", "has stack trace");
+  assert.ok(
+    /^TApplicationException: foo/.test(e.stack),
+    "Stack trace has correct error name and message"
+  );
+  assert.ok(
+    e.stack.indexOf("test/exceptions.js:7:11") !== -1,
+    "stack trace starts on correct line and column"
+  );
+  assert.equal(
+    e.name,
+    "TApplicationException",
+    "has function name TApplicationException"
+  );
+  assert.equal(e.message, "foo", 'has error message "foo"');
+  assert.equal(e.type, 1, "has type 1");
   assert.end();
 });
 
-test('unexpected TApplicationException ', function t(assert) {
-  var e = new thrift.TApplicationException(1, 100);
-  assert.ok(e instanceof thrift.TApplicationException, 'is instanceof TApplicationException');
-  assert.ok(e instanceof thrift.TException, 'is instanceof TException');
-  assert.ok(e instanceof Error, 'is instanceof Error');
-  assert.equal(typeof e.stack, 'string', 'has stack trace');
-  assert.ok(/^TApplicationException: 100/.test(e.stack), 'Stack trace has correct error name and message');
-  assert.ok(e.stack.indexOf('test/exceptions.js:7:11') !== -1, 'stack trace starts on correct line and column');
-  assert.equal(e.name, 'TApplicationException', 'has function name TApplicationException');
-  assert.equal(e.message, 100, 'has error message 100');
-  assert.equal(e.type, 1, 'has type 1');
+test("unexpected TApplicationException ", function t(assert) {
+  const e = new thrift.TApplicationException(1, 100);
+  assert.ok(
+    e instanceof thrift.TApplicationException,
+    "is instanceof TApplicationException"
+  );
+  assert.ok(e instanceof thrift.TException, "is instanceof TException");
+  assert.ok(e instanceof Error, "is instanceof Error");
+  assert.equal(typeof e.stack, "string", "has stack trace");
+  assert.ok(
+    /^TApplicationException: 100/.test(e.stack),
+    "Stack trace has correct error name and message"
+  );
+  assert.ok(
+    e.stack.indexOf("test/exceptions.js:7:11") !== -1,
+    "stack trace starts on correct line and column"
+  );
+  assert.equal(
+    e.name,
+    "TApplicationException",
+    "has function name TApplicationException"
+  );
+  assert.equal(e.message, 100, "has error message 100");
+  assert.equal(e.type, 1, "has type 1");
   assert.end();
 });
 
-test('TException', function t(assert) {
-  var e = new thrift.TException('foo');
-  assert.ok(e instanceof thrift.TException, 'is instanceof TException');
-  assert.ok(e instanceof Error, 'is instanceof Error');
-  assert.equal(typeof e.stack, 'string', 'has stack trace');
-  assert.ok(/^TException: foo/.test(e.stack), 'Stack trace has correct error name and message');
-  assert.ok(e.stack.indexOf('test/exceptions.js:21:11') !== -1, 'stack trace starts on correct line and column');
-  assert.equal(e.name, 'TException', 'has function name TException');
-  assert.equal(e.message, 'foo', 'has error message "foo"');
+test("TException", function t(assert) {
+  const e = new thrift.TException("foo");
+  assert.ok(e instanceof thrift.TException, "is instanceof TException");
+  assert.ok(e instanceof Error, "is instanceof Error");
+  assert.equal(typeof e.stack, "string", "has stack trace");
+  assert.ok(
+    /^TException: foo/.test(e.stack),
+    "Stack trace has correct error name and message"
+  );
+  assert.ok(
+    e.stack.indexOf("test/exceptions.js:21:11") !== -1,
+    "stack trace starts on correct line and column"
+  );
+  assert.equal(e.name, "TException", "has function name TException");
+  assert.equal(e.message, "foo", 'has error message "foo"');
   assert.end();
 });
 
-test('TProtocolException', function t(assert) {
-  var e = new thrift.TProtocolException(1, 'foo');
-  assert.ok(e instanceof thrift.TProtocolException, 'is instanceof TProtocolException');
-  assert.ok(e instanceof Error, 'is instanceof Error');
-  assert.equal(typeof e.stack, 'string', 'has stack trace');
-  assert.ok(/^TProtocolException: foo/.test(e.stack), 'Stack trace has correct error name and message');
-  assert.ok(e.stack.indexOf('test/exceptions.js:33:11') !== -1, 'stack trace starts on correct line and column');
-  assert.equal(e.name, 'TProtocolException', 'has function name TProtocolException');
-  assert.equal(e.message, 'foo', 'has error message "foo"');
-  assert.equal(e.type, 1, 'has type 1');
+test("TProtocolException", function t(assert) {
+  const e = new thrift.TProtocolException(1, "foo");
+  assert.ok(
+    e instanceof thrift.TProtocolException,
+    "is instanceof TProtocolException"
+  );
+  assert.ok(e instanceof Error, "is instanceof Error");
+  assert.equal(typeof e.stack, "string", "has stack trace");
+  assert.ok(
+    /^TProtocolException: foo/.test(e.stack),
+    "Stack trace has correct error name and message"
+  );
+  assert.ok(
+    e.stack.indexOf("test/exceptions.js:33:11") !== -1,
+    "stack trace starts on correct line and column"
+  );
+  assert.equal(
+    e.name,
+    "TProtocolException",
+    "has function name TProtocolException"
+  );
+  assert.equal(e.message, "foo", 'has error message "foo"');
+  assert.equal(e.type, 1, "has type 1");
   assert.end();
 });
 
-test('InputBufferUnderrunError', function t(assert) {
-  var e = new InputBufferUnderrunError('foo');
-  assert.ok(e instanceof InputBufferUnderrunError, 'is instanceof InputBufferUnderrunError');
-  assert.ok(e instanceof Error, 'is instanceof Error');
-  assert.equal(typeof e.stack, 'string', 'has stack trace');
-  assert.ok(/^InputBufferUnderrunError: foo/.test(e.stack), 'Stack trace has correct error name and message');
-  assert.ok(e.stack.indexOf('test/exceptions.js:46:11') !== -1, 'stack trace starts on correct line and column');
-  assert.equal(e.name, 'InputBufferUnderrunError', 'has function name InputBufferUnderrunError');
-  assert.equal(e.message, 'foo', 'has error message "foo"');
+test("InputBufferUnderrunError", function t(assert) {
+  const e = new InputBufferUnderrunError("foo");
+  assert.ok(
+    e instanceof InputBufferUnderrunError,
+    "is instanceof InputBufferUnderrunError"
+  );
+  assert.ok(e instanceof Error, "is instanceof Error");
+  assert.equal(typeof e.stack, "string", "has stack trace");
+  assert.ok(
+    /^InputBufferUnderrunError: foo/.test(e.stack),
+    "Stack trace has correct error name and message"
+  );
+  assert.ok(
+    e.stack.indexOf("test/exceptions.js:46:11") !== -1,
+    "stack trace starts on correct line and column"
+  );
+  assert.equal(
+    e.name,
+    "InputBufferUnderrunError",
+    "has function name InputBufferUnderrunError"
+  );
+  assert.equal(e.message, "foo", 'has error message "foo"');
   assert.end();
 });
diff --git a/lib/nodejs/test/helpers.js b/lib/nodejs/test/helpers.js
index 5f828b3..72d128d 100644
--- a/lib/nodejs/test/helpers.js
+++ b/lib/nodejs/test/helpers.js
@@ -17,16 +17,21 @@
  * under the License.
  */
 
-'use strict';
-var thrift = require('../lib/thrift');
+"use strict";
+const thrift = require("../lib/thrift");
 
 module.exports.transports = {
-  'buffered': thrift.TBufferedTransport,
-  'framed': thrift.TFramedTransport
+  buffered: thrift.TBufferedTransport,
+  framed: thrift.TFramedTransport
 };
 
 module.exports.protocols = {
-  'json': thrift.TJSONProtocol,
-  'binary': thrift.TBinaryProtocol,
-  'compact': thrift.TCompactProtocol
+  json: thrift.TJSONProtocol,
+  binary: thrift.TBinaryProtocol,
+  compact: thrift.TCompactProtocol
 };
+
+module.exports.ecmaMode = process.argv.includes("--es6") ? "es6" : "es5";
+module.exports.genPath = process.argv.includes("--es6")
+  ? "gen-nodejs-es6"
+  : "gen-nodejs";
diff --git a/lib/nodejs/test/server.js b/lib/nodejs/test/server.js
index 030d28b..7402094 100644
--- a/lib/nodejs/test/server.js
+++ b/lib/nodejs/test/server.js
@@ -19,96 +19,119 @@
  * under the License.
  */
 
-var fs = require('fs');
-var path = require('path');
-var thrift = require('../lib/thrift');
-var program = require('commander');
-var helpers = require('./helpers');
-
-var ThriftTest = require('./gen-nodejs/ThriftTest');
-var SecondService = require('./gen-nodejs/SecondService');
-var ThriftTestHandler = require('./test_handler').AsyncThriftTestHandler;
-var ThriftTestHandlerPromise = require('./test_handler').SyncThriftTestHandler;
-var ttypes = require('./gen-nodejs/ThriftTest_types');
+const fs = require("fs");
+const path = require("path");
+const thrift = require("../lib/thrift");
+const program = require("commander");
+const helpers = require("./helpers");
 
 program
-  .option('-p, --protocol <protocol>', 'Set thrift protocol (binary|compact|json)', 'binary')
-  .option('-t, --transport <transport>', 'Set thrift transport (buffered|framed|http)', 'buffered')
-  .option('--ssl', 'use ssl transport')
-  .option('--port <port>', 'Set thrift server port', 9090)
-  .option('--domain-socket <path>', 'Set thift server unix domain socket')
-  .option('--promise', 'test with promise style functions')
-  .option('-t, --type <type>', 'Select server type (http|multiplex|tcp|websocket)', 'tcp')
+  .option(
+    "-p, --protocol <protocol>",
+    "Set thrift protocol (binary|compact|json)",
+    "binary"
+  )
+  .option(
+    "-t, --transport <transport>",
+    "Set thrift transport (buffered|framed|http)",
+    "buffered"
+  )
+  .option("--ssl", "use ssl transport")
+  .option("--port <port>", "Set thrift server port", 9090)
+  .option("--domain-socket <path>", "Set thift server unix domain socket")
+  .option(
+    "-t, --type <type>",
+    "Select server type (http|multiplex|tcp|websocket)",
+    "tcp"
+  )
+  .option("--callback", "test with callback style functions")
+  .option("--es6", "Use es6 code")
+  .option("--es5", "Use es5 code")
   .parse(process.argv);
 
-var port = program.port;
-var domainSocket = program.domainSocket;
-var type = program.type;
-var ssl = program.ssl;
-var promise = program.promise;
+const ThriftTest = require(`./${helpers.genPath}/ThriftTest`);
+const SecondService = require(`./${helpers.genPath}/SecondService`);
+const { ThriftTestHandler } = require("./test_handler");
 
-var handler = program.promise ? ThriftTestHandler : ThriftTestHandlerPromise;
+const port = program.port;
+const domainSocket = program.domainSocket;
+const ssl = program.ssl;
 
-if (program.transport === 'http') {
-  program.transport = 'buffered';
-  type = 'http';
+let type = program.type;
+if (program.transport === "http") {
+  program.transport = "buffered";
+  type = "http";
 }
 
-var options = {
+let options = {
   transport: helpers.transports[program.transport],
   protocol: helpers.protocols[program.protocol]
 };
 
-if (type === 'http' || type ==='websocket') {
-  options.handler = handler;
+if (type === "http" || type === "websocket") {
+  options.handler = ThriftTestHandler;
   options.processor = ThriftTest;
 
   options = {
     services: { "/test": options },
     cors: {
-      '*': true
+      "*": true
     }
-  }
+  };
 }
 
-if (type === 'multiplex') {
-  var SecondServiceHandler = {
+let processor;
+if (type === "multiplex") {
+  const SecondServiceHandler = {
     secondtestString: function(thing, result) {
       console.log('testString("' + thing + '")');
       result(null, 'testString("' + thing + '")');
     }
   };
 
-  var processor = new thrift.MultiplexedProcessor();
+  processor = new thrift.MultiplexedProcessor();
 
-  processor.registerProcessor("ThriftTest",
-    new ThriftTest.Processor(ThriftTestHandler));
+  processor.registerProcessor(
+    "ThriftTest",
+    new ThriftTest.Processor(ThriftTestHandler)
+  );
 
-  processor.registerProcessor("SecondService",
-    new SecondService.Processor(SecondServiceHandler));
-
+  processor.registerProcessor(
+    "SecondService",
+    new SecondService.Processor(SecondServiceHandler)
+  );
 }
 
 if (ssl) {
-  if (type === 'tcp' || type === 'multiplex' || type === 'http' || type === 'websocket') {
+  if (
+    type === "tcp" ||
+    type === "multiplex" ||
+    type === "http" ||
+    type === "websocket"
+  ) {
     options.tls = {
-      key: fs.readFileSync(path.resolve(__dirname, 'server.key')),
-      cert: fs.readFileSync(path.resolve(__dirname, 'server.crt'))
+      key: fs.readFileSync(path.resolve(__dirname, "server.key")),
+      cert: fs.readFileSync(path.resolve(__dirname, "server.crt"))
     };
   }
 }
 
-var server;
-if (type === 'tcp') {
-  server = thrift.createServer(ThriftTest, handler, options);
-} else if (type === 'multiplex') {
+let server;
+if (type === "tcp") {
+  server = thrift.createServer(ThriftTest, ThriftTestHandler, options);
+} else if (type === "multiplex") {
   server = thrift.createMultiplexServer(processor, options);
-} else if (type === 'http' || type === 'websocket') {
+} else if (type === "http" || type === "websocket") {
   server = thrift.createWebServer(options);
 }
 
 if (domainSocket) {
   server.listen(domainSocket);
-} else if (type === 'tcp' || type === 'multiplex' || type === 'http' || type === 'websocket') {
+} else if (
+  type === "tcp" ||
+  type === "multiplex" ||
+  type === "http" ||
+  type === "websocket"
+) {
   server.listen(port);
 }
diff --git a/lib/nodejs/test/test-cases.js b/lib/nodejs/test/test-cases.js
index bd66dc4..02c566f 100644
--- a/lib/nodejs/test/test-cases.js
+++ b/lib/nodejs/test/test-cases.js
@@ -17,139 +17,156 @@
  * under the License.
  */
 
-'use strict';
+"use strict";
 
-var ttypes = require('./gen-nodejs/ThriftTest_types');
-var Int64 = require('node-int64');
+const helpers = require("./helpers");
+const ttypes = require(`./${helpers.genPath}/ThriftTest_types`);
+const Int64 = require("node-int64");
 
 //all Languages in UTF-8
 /*jshint -W100 */
-var stringTest = module.exports.stringTest = "Afrikaans, Alemannisch, Aragonés, العربية, مصرى, " +
-    "Asturianu, Aymar aru, Azərbaycan, Башҡорт, Boarisch, Žemaitėška, " +
-    "Беларуская, Беларуская (тарашкевіца), Български, Bamanankan, " +
-    "বাংলা, Brezhoneg, Bosanski, Català, Mìng-dĕ̤ng-ngṳ̄, Нохчийн, " +
-    "Cebuano, ᏣᎳᎩ, Česky, Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ, Чӑвашла, Cymraeg, " +
-    "Dansk, Zazaki, ދިވެހިބަސް, Ελληνικά, Emiliàn e rumagnòl, English, " +
-    "Esperanto, Español, Eesti, Euskara, فارسی, Suomi, Võro, Føroyskt, " +
-    "Français, Arpetan, Furlan, Frysk, Gaeilge, 贛語, Gàidhlig, Galego, " +
-    "Avañe'ẽ, ગુજરાતી, Gaelg, עברית, हिन्दी, Fiji Hindi, Hrvatski, " +
-    "Kreyòl ayisyen, Magyar, Հայերեն, Interlingua, Bahasa Indonesia, " +
-    "Ilokano, Ido, Íslenska, Italiano, 日本語, Lojban, Basa Jawa, " +
-    "ქართული, Kongo, Kalaallisut, ಕನ್ನಡ, 한국어, Къарачай-Малкъар, " +
-    "Ripoarisch, Kurdî, Коми, Kernewek, Кыргызча, Latina, Ladino, " +
-    "Lëtzebuergesch, Limburgs, Lingála, ລາວ, Lietuvių, Latviešu, Basa " +
-    "Banyumasan, Malagasy, Македонски, മലയാളം, मराठी, مازِرونی, Bahasa " +
-    "Melayu, Nnapulitano, Nedersaksisch, नेपाल भाषा, Nederlands, ‪" +
-    "Norsk (nynorsk)‬, ‪Norsk (bokmål)‬, Nouormand, Diné bizaad, " +
-    "Occitan, Иронау, Papiamentu, Deitsch, Polski, پنجابی, پښتو, " +
-    "Norfuk / Pitkern, Português, Runa Simi, Rumantsch, Romani, Română, " +
-    "Русский, Саха тыла, Sardu, Sicilianu, Scots, Sámegiella, Simple " +
-    "English, Slovenčina, Slovenščina, Српски / Srpski, Seeltersk, " +
-    "Svenska, Kiswahili, தமிழ், తెలుగు, Тоҷикӣ, ไทย, Türkmençe, Tagalog, " +
-    "Türkçe, Татарча/Tatarça, Українська, اردو, Tiếng Việt, Volapük, " +
-    "Walon, Winaray, 吴语, isiXhosa, ייִדיש, Yorùbá, Zeêuws, 中文, " +
-    "Bân-lâm-gú, 粵語";
+const stringTest = (module.exports.stringTest =
+  "Afrikaans, Alemannisch, Aragonés, العربية, مصرى, " +
+  "Asturianu, Aymar aru, Azərbaycan, Башҡорт, Boarisch, Žemaitėška, " +
+  "Беларуская, Беларуская (тарашкевіца), Български, Bamanankan, " +
+  "বাংলা, Brezhoneg, Bosanski, Català, Mìng-dĕ̤ng-ngṳ̄, Нохчийн, " +
+  "Cebuano, ᏣᎳᎩ, Česky, Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ, Чӑвашла, Cymraeg, " +
+  "Dansk, Zazaki, ދިވެހިބަސް, Ελληνικά, Emiliàn e rumagnòl, English, " +
+  "Esperanto, Español, Eesti, Euskara, فارسی, Suomi, Võro, Føroyskt, " +
+  "Français, Arpetan, Furlan, Frysk, Gaeilge, 贛語, Gàidhlig, Galego, " +
+  "Avañe'ẽ, ગુજરાતી, Gaelg, עברית, हिन्दी, Fiji Hindi, Hrvatski, " +
+  "Kreyòl ayisyen, Magyar, Հայերեն, Interlingua, Bahasa Indonesia, " +
+  "Ilokano, Ido, Íslenska, Italiano, 日本語, Lojban, Basa Jawa, " +
+  "ქართული, Kongo, Kalaallisut, ಕನ್ನಡ, 한국어, Къарачай-Малкъар, " +
+  "Ripoarisch, Kurdî, Коми, Kernewek, Кыргызча, Latina, Ladino, " +
+  "Lëtzebuergesch, Limburgs, Lingála, ລາວ, Lietuvių, Latviešu, Basa " +
+  "Banyumasan, Malagasy, Македонски, മലയാളം, मराठी, مازِرونی, Bahasa " +
+  "Melayu, Nnapulitano, Nedersaksisch, नेपाल भाषा, Nederlands, ‪" +
+  "Norsk (nynorsk)‬, ‪Norsk (bokmål)‬, Nouormand, Diné bizaad, " +
+  "Occitan, Иронау, Papiamentu, Deitsch, Polski, پنجابی, پښتو, " +
+  "Norfuk / Pitkern, Português, Runa Simi, Rumantsch, Romani, Română, " +
+  "Русский, Саха тыла, Sardu, Sicilianu, Scots, Sámegiella, Simple " +
+  "English, Slovenčina, Slovenščina, Српски / Srpski, Seeltersk, " +
+  "Svenska, Kiswahili, தமிழ், తెలుగు, Тоҷикӣ, ไทย, Türkmençe, Tagalog, " +
+  "Türkçe, Татарча/Tatarça, Українська, اردو, Tiếng Việt, Volapük, " +
+  "Walon, Winaray, 吴语, isiXhosa, ייִדיש, Yorùbá, Zeêuws, 中文, " +
+  "Bân-lâm-gú, 粵語");
 /*jshint +W100 */
 
-var specialCharacters = module.exports.specialCharacters = 'quote: \" backslash:' +
-    ' forwardslash-escaped: \/ ' +
-    ' backspace: \b formfeed: \f newline: \n return: \r tab: ' +
-    ' now-all-of-them-together: "\\\/\b\n\r\t' +
-    ' now-a-bunch-of-junk: !@#$%&()(&%$#{}{}<><><' +
-    ' char-to-test-json-parsing: ]] \"]] \\" }}}{ [[[ ';
+const specialCharacters = (module.exports.specialCharacters =
+  'quote: " backslash:' +
+  " forwardslash-escaped: / " +
+  " backspace: \b formfeed: \f newline: \n return: \r tab: " +
+  ' now-all-of-them-together: "\\/\b\n\r\t' +
+  " now-a-bunch-of-junk: !@#$%&()(&%$#{}{}<><><" +
+  ' char-to-test-json-parsing: ]] "]] \\" }}}{ [[[ ');
 
-var mapTestInput = module.exports.mapTestInput = {
-  "a":"123", "a b":"with spaces ", "same":"same", "0":"numeric key",
-  "longValue":stringTest, stringTest:"long key"
-};
+const mapTestInput = (module.exports.mapTestInput = {
+  a: "123",
+  "a b": "with spaces ",
+  same: "same",
+  "0": "numeric key",
+  longValue: stringTest,
+  stringTest: "long key"
+});
 
-var simple = [
-  ['testVoid', undefined],
-  ['testString', 'Test'],
-  ['testString', ''],
-  ['testString', stringTest],
-  ['testString', specialCharacters],
-  ['testBool', true],
-  ['testBool', false],
-  ['testByte', 1],
-  ['testByte', 0],
-  ['testByte', -1],
-  ['testByte', -127],
-  ['testI32', -1],
-  ['testDouble', -5.2098523],
-  ['testDouble', 7.012052175215044],
-  ['testEnum', ttypes.Numberz.ONE],
-  ['testI64', 5],
-  ['testI64', -5],
-  ['testI64', 734359738368],
-  ['testI64', -734359738368],
-  ['testI64', new Int64(new Buffer([0, 0x20, 0, 0, 0, 0, 0, 1]))],  // 2^53+1
-  ['testI64', new Int64(
-      new Buffer([0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]))],  // -2^53-1
-  ['testTypedef', 69]
-]
+const simple = [
+  ["testVoid", undefined],
+  ["testString", "Test"],
+  ["testString", ""],
+  ["testString", stringTest],
+  ["testString", specialCharacters],
+  ["testBool", true],
+  ["testBool", false],
+  ["testByte", 1],
+  ["testByte", 0],
+  ["testByte", -1],
+  ["testByte", -127],
+  ["testI32", -1],
+  ["testDouble", -5.2098523],
+  ["testDouble", 7.012052175215044],
+  ["testEnum", ttypes.Numberz.ONE],
+  ["testI64", 5],
+  ["testI64", -5],
+  ["testI64", 734359738368],
+  ["testI64", -734359738368],
+  ["testI64", new Int64(new Buffer([0, 0x20, 0, 0, 0, 0, 0, 1]))], // 2^53+1
+  [
+    "testI64",
+    new Int64(new Buffer([0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]))
+  ], // -2^53-1
+  ["testTypedef", 69]
+];
 
-var mapout = {};
-for (var i = 0; i < 5; ++i) {
-  mapout[i] = i-10;
+const mapout = {};
+for (let i = 0; i < 5; ++i) {
+  mapout[i] = i - 10;
 }
 
-var deep = [
-  ['testList', [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]],
+const deep = [
+  [
+    "testList",
+    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
+  ]
 ];
 
-var deepUnordered = [
-  ['testMap', mapout],
-  ['testSet', [1,2,3]],
-  ['testStringMap', mapTestInput]
+const deepUnordered = [
+  ["testMap", mapout],
+  ["testSet", [1, 2, 3]],
+  ["testStringMap", mapTestInput]
 ];
 
-var out = new ttypes.Xtruct({
-  string_thing: 'Zero',
+const out = new ttypes.Xtruct({
+  string_thing: "Zero",
   byte_thing: 1,
   i32_thing: -3,
   i64_thing: 1000000
 });
 
-var out2 = new ttypes.Xtruct2();
+const out2 = new ttypes.Xtruct2();
 out2.byte_thing = 1;
 out2.struct_thing = out;
 out2.i32_thing = 5;
 
-var crazy = new ttypes.Insanity({
-  "userMap":{ "5":5, "8":8 },
-  "xtructs":[new ttypes.Xtruct({
-      "string_thing":"Goodbye4",
-      "byte_thing":4,
-      "i32_thing":4,
-      "i64_thing":4
-    }), new ttypes.Xtruct({
-      "string_thing":"Hello2",
-      "byte_thing":2,
-      "i32_thing":2,
-      "i64_thing":2
-    })]
+const crazy = new ttypes.Insanity({
+  userMap: { "5": 5, "8": 8 },
+  xtructs: [
+    new ttypes.Xtruct({
+      string_thing: "Goodbye4",
+      byte_thing: 4,
+      i32_thing: 4,
+      i64_thing: 4
+    }),
+    new ttypes.Xtruct({
+      string_thing: "Hello2",
+      byte_thing: 2,
+      i32_thing: 2,
+      i64_thing: 2
+    })
+  ]
 });
 
-var crazy2 = new ttypes.Insanity({
-  "userMap":{ "5":5, "8":8 },
-  "xtructs":[{
-      "string_thing":"Goodbye4",
-      "byte_thing":4,
-      "i32_thing":4,
-      "i64_thing":4
-    }, {
-      "string_thing":"Hello2",
-      "byte_thing":2,
-      "i32_thing":2,
-      "i64_thing":2
-    }]
+const crazy2 = new ttypes.Insanity({
+  userMap: { "5": 5, "8": 8 },
+  xtructs: [
+    {
+      string_thing: "Goodbye4",
+      byte_thing: 4,
+      i32_thing: 4,
+      i64_thing: 4
+    },
+    {
+      string_thing: "Hello2",
+      byte_thing: 2,
+      i32_thing: 2,
+      i64_thing: 2
+    }
+  ]
 });
 
-
-var insanity = {
-  "1":{ "2": crazy, "3": crazy },
-  "2":{ "6":{ "userMap":{}, "xtructs":[] } }
+const insanity = {
+  "1": { "2": crazy, "3": crazy },
+  "2": { "6": { userMap: {}, xtructs: [] } }
 };
 
 module.exports.simple = simple;
diff --git a/lib/nodejs/test/testAll.sh b/lib/nodejs/test/testAll.sh
index ac22b64..24f1f2e 100755
--- a/lib/nodejs/test/testAll.sh
+++ b/lib/nodejs/test/testAll.sh
@@ -33,21 +33,21 @@
 
 testServer()
 {
-  echo "   Testing $1 Client/Server with protocol $2 and transport $3 $4";
+  echo "  [ECMA $1] Testing $2 Client/Server with protocol $3 and transport $4 $5";
   RET=0
   if [ -n "${COVER}" ]; then
-    ${ISTANBUL} cover ${DIR}/server.js --dir ${REPORT_PREFIX}${COUNT} --handle-sigint -- --type $1 -p $2 -t $3 $4 &
+    ${ISTANBUL} cover ${DIR}/server.js --dir ${REPORT_PREFIX}${COUNT} --handle-sigint -- --type $2 -p $3 -t $4 $5 &
     COUNT=$((COUNT+1))
   else
-    node ${DIR}/server.js --type $1 -p $2 -t $3 $4 &
+    node ${DIR}/server.js --${1} --type $2 -p $3 -t $4 $5 &
   fi
   SERVERPID=$!
   sleep 0.1
   if [ -n "${COVER}" ]; then
-    ${ISTANBUL} cover ${DIR}/client.js --dir ${REPORT_PREFIX}${COUNT} -- --type $1 -p $2 -t $3 $4 || RET=1
+    ${ISTANBUL} cover ${DIR}/client.js --dir ${REPORT_PREFIX}${COUNT} -- --${1} --type $2 -p $3 -t $4 $5 || RET=1
     COUNT=$((COUNT+1))
   else
-    node ${DIR}/client.js --type $1 -p $2 -t $3 $4 || RET=1
+    node ${DIR}/client.js --${1} --type $2 -p $3 -t $4 $5 || RET=1
   fi
   kill -2 $SERVERPID || RET=1
   wait $SERVERPID
@@ -61,6 +61,9 @@
 
 ${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node ${DIR}/../../../test/ThriftTest.thrift
 ${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node ${DIR}/../../../test/JsDeepConstructorTest.thrift
+mkdir ${DIR}/gen-nodejs-es6
+${DIR}/../../../compiler/cpp/thrift -out ${DIR}/gen-nodejs-es6 --gen js:node,es6 ${DIR}/../../../test/ThriftTest.thrift
+${DIR}/../../../compiler/cpp/thrift -out ${DIR}/gen-nodejs-es6 --gen js:node,es6 ${DIR}/../../../test/JsDeepConstructorTest.thrift
 
 #unit tests
 
@@ -71,15 +74,16 @@
 
 for type in tcp multiplex websocket http
 do
-
   for protocol in compact binary json
   do
-
     for transport in buffered framed
     do
-      testServer $type $protocol $transport || TESTOK=1
-      testServer $type $protocol $transport --ssl || TESTOK=1
-      testServer $type $protocol $transport --promise || TESTOK=1
+      for ecma_version in es5 es6
+      do
+        testServer $ecma_version $type $protocol $transport || TESTOK=1
+        testServer $ecma_version $type $protocol $transport --ssl || TESTOK=1
+        testServer $ecma_version $type $protocol $transport --callback || TESTOK=1
+      done
     done
   done
 done
diff --git a/lib/nodejs/test/test_driver.js b/lib/nodejs/test/test_driver.js
index 4612a32..7c9a919 100644
--- a/lib/nodejs/test/test_driver.js
+++ b/lib/nodejs/test/test_driver.js
@@ -17,252 +17,279 @@
  * under the License.
  */
 
- // This is the Node.js test driver for the standard Apache Thrift
- // test service. The driver invokes every function defined in the
- // Thrift Test service with a representative range of parameters.
- //
- // The ThriftTestDriver function requires a client object
- // connected to a server hosting the Thrift Test service and
- // supports an optional callback function which is called with
- // a status message when the test is complete.
+// This is the Node.js test driver for the standard Apache Thrift
+// test service. The driver invokes every function defined in the
+// Thrift Test service with a representative range of parameters.
+//
+// The ThriftTestDriver function requires a client object
+// connected to a server hosting the Thrift Test service and
+// supports an optional callback function which is called with
+// a status message when the test is complete.
 
-var test = require('tape');
-//var assert = require('assert');
-var ttypes = require('./gen-nodejs/ThriftTest_types');
-var TException = require('thrift').Thrift.TException;
-var Int64 = require('node-int64');
-var testCases = require('./test-cases');
+const test = require("tape");
+
+const helpers = require("./helpers");
+const ttypes = require(`./${helpers.genPath}/ThriftTest_types`);
+const TException = require("thrift").Thrift.TException;
+const Int64 = require("node-int64");
+const testCases = require("./test-cases");
 
 exports.ThriftTestDriver = function(client, callback) {
+  test(
+    "NodeJS Style Callback Client Tests",
+    { skip: helpers.ecmaMode === "es6" },
+    function(assert) {
+      const checkRecursively = makeRecursiveCheck(assert);
 
-  test('NodeJS Style Callback Client Tests', function(assert) {
-
-    var checkRecursively = makeRecursiveCheck(assert);
-
-    function makeAsserter(assertionFn) {
-      return function(c) {
-        var fnName = c[0];
-        var expected = c[1];
-        client[fnName](expected, function(err, actual) {
-          assert.error(err, fnName + ': no callback error');
-          assertionFn(actual, expected, fnName);
-        })
-      };
-    }
-
-    testCases.simple.forEach(makeAsserter(function(a, e, m){
-      if (a instanceof Int64) {
-        var e64 = e instanceof Int64 ? e : new Int64(e);
-        assert.deepEqual(a.buffer, e64.buffer, m);
-      } else {
-        assert.equal(a, e, m);
+      function makeAsserter(assertionFn) {
+        return function(c) {
+          const fnName = c[0];
+          const expected = c[1];
+          client[fnName](expected, function(err, actual) {
+            assert.error(err, fnName + ": no callback error");
+            assertionFn(actual, expected, fnName);
+          });
+        };
       }
-    }));
-    testCases.deep.forEach(makeAsserter(assert.deepEqual));
-    testCases.deepUnordered.forEach(makeAsserter(makeUnorderedDeepEqual(assert)));
 
-    var arr = [];
-    for (var i = 0; i < 256; ++i) {
-      arr[i] = 255 - i;
-    }
-    var buf = new Buffer(arr);
-    client.testBinary(buf, function(err, response) {
-      assert.error(err, 'testBinary: no callback error');
-      assert.equal(response.length, 256, 'testBinary');
-      assert.deepEqual(response, buf, 'testBinary(Buffer)');
-    });
-    var buf = new Buffer(arr);
-    client.testBinary(buf.toString('binary'), function(err, response) {
-      assert.error(err, 'testBinary: no callback error');
-      assert.equal(response.length, 256, 'testBinary');
-      assert.deepEqual(response, buf, 'testBinary(string)');
-    });
+      testCases.simple.forEach(
+        makeAsserter(function(a, e, m) {
+          if (a instanceof Int64) {
+            const e64 = e instanceof Int64 ? e : new Int64(e);
+            assert.deepEqual(a.buffer, e64.buffer, m);
+          } else {
+            assert.equal(a, e, m);
+          }
+        })
+      );
+      testCases.deep.forEach(makeAsserter(assert.deepEqual));
+      testCases.deepUnordered.forEach(
+        makeAsserter(makeUnorderedDeepEqual(assert))
+      );
 
-    client.testMapMap(42, function(err, response) {
-      var expected = {
-        "4": {"1":1, "2":2, "3":3, "4":4},
-        "-4": {"-4":-4, "-3":-3, "-2":-2, "-1":-1}
-      };
-      assert.error(err, 'testMapMap: no callback error');
-      assert.deepEqual(expected, response, 'testMapMap');
-    });
-
-    client.testStruct(testCases.out, function(err, response) {
-      assert.error(err, 'testStruct: no callback error');
-      checkRecursively(testCases.out, response, 'testStruct');
-    });
-
-    client.testNest(testCases.out2, function(err, response) {
-      assert.error(err, 'testNest: no callback error');
-      checkRecursively(testCases.out2, response, 'testNest');
-    });
-
-    client.testInsanity(testCases.crazy, function(err, response) {
-      assert.error(err, 'testInsanity: no callback error');
-      checkRecursively(testCases.insanity, response, 'testInsanity');
-    });
-
-    client.testInsanity(testCases.crazy2, function(err, response) {
-      assert.error(err, 'testInsanity2: no callback error');
-      checkRecursively(testCases.insanity, response, 'testInsanity2');
-    });
-
-    client.testException('TException', function(err, response) {
-      assert.ok(err instanceof TException, 'testException: correct error type');
-      assert.ok(!response, 'testException: no response');
-    });
-
-    client.testException('Xception', function(err, response) {
-      assert.ok(err instanceof ttypes.Xception, 'testException: correct error type');
-      assert.ok(!response, 'testException: no response');
-      assert.equal(err.errorCode, 1001, 'testException: correct error code');
-      assert.equal('Xception', err.message, 'testException: correct error message');
-    });
-
-    client.testException('no Exception', function(err, response) {
-      assert.error(err, 'testException: no callback error');
-      assert.ok(!response, 'testException: no response');
-    });
-
-    client.testOneway(0, function(err, response) {
-      assert.error(err, 'testOneway: no callback error');
-      assert.strictEqual(response, undefined, 'testOneway: void response');
-    });
-
-    checkOffByOne(function(done) {
-      client.testI32(-1, function(err, response) {
-        assert.error(err, 'checkOffByOne: no callback error');
-        assert.equal(-1, response);
-        assert.end();
-        done();
+      const arr = [];
+      for (let i = 0; i < 256; ++i) {
+        arr[i] = 255 - i;
+      }
+      let buf = new Buffer(arr);
+      client.testBinary(buf, function(err, response) {
+        assert.error(err, "testBinary: no callback error");
+        assert.equal(response.length, 256, "testBinary");
+        assert.deepEqual(response, buf, "testBinary(Buffer)");
       });
-    }, callback);
+      buf = new Buffer(arr);
+      client.testBinary(buf.toString("binary"), function(err, response) {
+        assert.error(err, "testBinary: no callback error");
+        assert.equal(response.length, 256, "testBinary");
+        assert.deepEqual(response, buf, "testBinary(string)");
+      });
 
-  });
+      client.testMapMap(42, function(err, response) {
+        const expected = {
+          "4": { "1": 1, "2": 2, "3": 3, "4": 4 },
+          "-4": { "-4": -4, "-3": -3, "-2": -2, "-1": -1 }
+        };
+        assert.error(err, "testMapMap: no callback error");
+        assert.deepEqual(expected, response, "testMapMap");
+      });
+
+      client.testStruct(testCases.out, function(err, response) {
+        assert.error(err, "testStruct: no callback error");
+        checkRecursively(testCases.out, response, "testStruct");
+      });
+
+      client.testNest(testCases.out2, function(err, response) {
+        assert.error(err, "testNest: no callback error");
+        checkRecursively(testCases.out2, response, "testNest");
+      });
+
+      client.testInsanity(testCases.crazy, function(err, response) {
+        assert.error(err, "testInsanity: no callback error");
+        checkRecursively(testCases.insanity, response, "testInsanity");
+      });
+
+      client.testInsanity(testCases.crazy2, function(err, response) {
+        assert.error(err, "testInsanity2: no callback error");
+        checkRecursively(testCases.insanity, response, "testInsanity2");
+      });
+
+      client.testException("TException", function(err, response) {
+        assert.ok(
+          err instanceof TException,
+          "testException: correct error type"
+        );
+        assert.ok(!response, "testException: no response");
+      });
+
+      client.testException("Xception", function(err, response) {
+        assert.ok(
+          err instanceof ttypes.Xception,
+          "testException: correct error type"
+        );
+        assert.ok(!response, "testException: no response");
+        assert.equal(err.errorCode, 1001, "testException: correct error code");
+        assert.equal(
+          "Xception",
+          err.message,
+          "testException: correct error message"
+        );
+      });
+
+      client.testException("no Exception", function(err, response) {
+        assert.error(err, "testException: no callback error");
+        assert.ok(!response, "testException: no response");
+      });
+
+      client.testOneway(0, function(err, response) {
+        assert.error(err, "testOneway: no callback error");
+        assert.strictEqual(response, undefined, "testOneway: void response");
+      });
+
+      checkOffByOne(function(done) {
+        client.testI32(-1, function(err, response) {
+          assert.error(err, "checkOffByOne: no callback error");
+          assert.equal(-1, response);
+          assert.end();
+          done();
+        });
+      }, callback);
+    }
+  );
+
+  // ES6 does not support callback style
+  if (helpers.ecmaMode === "es6") {
+    checkOffByOne(done => done(), callback);
+  }
 };
 
 exports.ThriftTestDriverPromise = function(client, callback) {
-
-  test('Q Promise Client Tests', function(assert) {
-
-    var checkRecursively = makeRecursiveCheck(assert);
-
-    function fail(msg) {
-      return function() {
-        assert.fail(msg);
-      }
-    }
+  test("Promise Client Tests", function(assert) {
+    const checkRecursively = makeRecursiveCheck(assert);
 
     function makeAsserter(assertionFn) {
       return function(c) {
-        var fnName = c[0];
-        var expected = c[1];
+        const fnName = c[0];
+        const expected = c[1];
         client[fnName](expected)
           .then(function(actual) {
             assertionFn(actual, expected, fnName);
           })
-          .fail(fail('fnName'));
+          .catch(() => assert.fail("fnName"));
       };
     }
 
-    testCases.simple.forEach(makeAsserter(function(a, e, m){
-      if (a instanceof Int64) {
-        var e64 = e instanceof Int64 ? e : new Int64(e);
-        assert.deepEqual(a.buffer, e64.buffer, m);
-      } else {
-        assert.equal(a, e, m);
-      }
-    }));
+    testCases.simple.forEach(
+      makeAsserter(function(a, e, m) {
+        if (a instanceof Int64) {
+          const e64 = e instanceof Int64 ? e : new Int64(e);
+          assert.deepEqual(a.buffer, e64.buffer, m);
+        } else {
+          assert.equal(a, e, m);
+        }
+      })
+    );
     testCases.deep.forEach(makeAsserter(assert.deepEqual));
-    testCases.deepUnordered.forEach(makeAsserter(makeUnorderedDeepEqual(assert)));
+    testCases.deepUnordered.forEach(
+      makeAsserter(makeUnorderedDeepEqual(assert))
+    );
 
-    client.testStruct(testCases.out)
+    client
+      .testStruct(testCases.out)
       .then(function(response) {
-        checkRecursively(testCases.out, response, 'testStruct');
+        checkRecursively(testCases.out, response, "testStruct");
       })
-      .fail(fail('testStruct'));
+      .catch(() => assert.fail("testStruct"));
 
-    client.testNest(testCases.out2)
+    client
+      .testNest(testCases.out2)
       .then(function(response) {
-        checkRecursively(testCases.out2, response, 'testNest');
+        checkRecursively(testCases.out2, response, "testNest");
       })
-      .fail(fail('testNest'));
+      .catch(() => assert.fail("testNest"));
 
-    client.testInsanity(testCases.crazy)
+    client
+      .testInsanity(testCases.crazy)
       .then(function(response) {
-        checkRecursively(testCases.insanity, response, 'testInsanity');
+        checkRecursively(testCases.insanity, response, "testInsanity");
       })
-      .fail(fail('testInsanity'));
+      .catch(() => assert.fail("testInsanity"));
 
-    client.testInsanity(testCases.crazy2)
+    client
+      .testInsanity(testCases.crazy2)
       .then(function(response) {
-        checkRecursively(testCases.insanity, response, 'testInsanity2');
+        checkRecursively(testCases.insanity, response, "testInsanity2");
       })
-      .fail(fail('testInsanity2'));
+      .catch(() => assert.fail("testInsanity2"));
 
-    client.testException('TException')
-      .then(function(response) {
-        fail('testException: TException');
+    client
+      .testException("TException")
+      .then(function() {
+        assert.fail("testException: TException");
       })
-      .fail(function(err) {
+      .catch(function(err) {
         assert.ok(err instanceof TException);
       });
 
-    client.testException('Xception')
-      .then(function(response) {
-        fail('testException: Xception');
+    client
+      .testException("Xception")
+      .then(function() {
+        assert.fail("testException: Xception");
       })
-      .fail(function(err) {
+      .catch(function(err) {
         assert.ok(err instanceof ttypes.Xception);
         assert.equal(err.errorCode, 1001);
-        assert.equal('Xception', err.message);
+        assert.equal("Xception", err.message);
       });
 
-    client.testException('no Exception')
+    client
+      .testException("no Exception")
       .then(function(response) {
         assert.equal(undefined, response); //void
       })
-      .fail(fail('testException'));
+      .catch(() => assert.fail("testException"));
 
-    client.testOneway(0)
+    client
+      .testOneway(0)
       .then(function(response) {
-        assert.strictEqual(response, undefined, 'testOneway: void response')
+        assert.strictEqual(response, undefined, "testOneway: void response");
       })
-      .fail(fail('testOneway: should not reject'));
+      .catch(() => assert.fail("testOneway: should not reject"));
 
     checkOffByOne(function(done) {
-      client.testI32(-1)
+      client
+        .testI32(-1)
         .then(function(response) {
-            assert.equal(-1, response);
-            assert.end();
-            done();
+          assert.equal(-1, response);
+          assert.end();
+          done();
         })
-        .fail(fail('checkOffByOne'));
+        .catch(() => assert.fail("checkOffByOne"));
     }, callback);
   });
 };
 
-
 // Helper Functions
 // =========================================================
 
 function makeRecursiveCheck(assert) {
-
-  return function (map1, map2, msg) {
-    var equal = true;
-
-    var equal = checkRecursively(map1, map2);
+  return function(map1, map2, msg) {
+    const equal = checkRecursively(map1, map2);
 
     assert.ok(equal, msg);
 
     // deepEqual doesn't work with fields using node-int64
     function checkRecursively(map1, map2) {
-      if (typeof map1 !== 'function' && typeof map2 !== 'function') {
-        if (!map1 || typeof map1 !== 'object') {
+      if (typeof map1 !== "function" && typeof map2 !== "function") {
+        if (!map1 || typeof map1 !== "object") {
           //Handle int64 types (which use node-int64 in Node.js JavaScript)
-          if ((typeof map1 === "number") && (typeof map2 === "object") &&
-              (map2.buffer) && (map2.buffer instanceof Buffer) && (map2.buffer.length === 8)) {
-            var n = new Int64(map2.buffer);
+          if (
+            typeof map1 === "number" &&
+            typeof map2 === "object" &&
+            map2.buffer &&
+            map2.buffer instanceof Buffer &&
+            map2.buffer.length === 8
+          ) {
+            const n = new Int64(map2.buffer);
             return map1 === n.toNumber();
           } else {
             return map1 == map2;
@@ -274,15 +301,14 @@
         }
       }
     }
-  }
+  };
 }
 
 function checkOffByOne(done, callback) {
-
-  var retry_limit = 30;
-  var retry_interval = 100;
-  var test_complete = false;
-  var retrys = 0;
+  const retry_limit = 30;
+  const retry_interval = 100;
+  let test_complete = false;
+  let retrys = 0;
 
   /**
    * redo a simple test after the oneway to make sure we aren't "off by one" --
@@ -299,14 +325,17 @@
 
   //We wait up to retry_limit * retry_interval for the test suite to complete
   function TestForCompletion() {
-    if(test_complete && callback) {
+    if (test_complete && callback) {
       callback("Server successfully tested!");
     } else {
       if (++retrys < retry_limit) {
         setTimeout(TestForCompletion, retry_interval);
       } else if (callback) {
-        callback("Server test failed to complete after " +
-                 (retry_limit * retry_interval / 1000) + " seconds");
+        callback(
+          "Server test failed to complete after " +
+            (retry_limit * retry_interval) / 1000 +
+            " seconds"
+        );
       }
     }
   }
@@ -317,15 +346,15 @@
 function makeUnorderedDeepEqual(assert) {
   return function(actual, expected, name) {
     assert.equal(actual.length, expected.length, name);
-    for (var k in actual) {
-      var found = false;
-      for (var k2 in expected) {
+    for (const k in actual) {
+      let found = false;
+      for (const k2 in expected) {
         if (actual[k] === expected[k2]) {
           found = true;
         }
       }
       if (!found) {
-        assert.fail('Unexpected value ' + actual[k] + ' with key ' + k);
+        assert.fail("Unexpected value " + actual[k] + " with key " + k);
       }
     }
   };
diff --git a/lib/nodejs/test/test_handler.js b/lib/nodejs/test/test_handler.js
index 5c89f7a..317a7c8 100644
--- a/lib/nodejs/test/test_handler.js
+++ b/lib/nodejs/test/test_handler.js
@@ -19,18 +19,17 @@
 
 //This is the server side Node test handler for the standard
 //  Apache Thrift test service.
+const helpers = require("./helpers");
+const ttypes = require(`./${helpers.genPath}/ThriftTest_types`);
+const TException = require("thrift").Thrift.TException;
 
-var ttypes = require('./gen-nodejs/ThriftTest_types');
-var TException = require('thrift').Thrift.TException;
-
-function makeSyncHandler(label) {
+function makeSyncHandler() {
   return function(thing) {
-    //console.log(label + '(\'' + thing + '\')');
     return thing;
-  }
+  };
 }
 
-var syncHandlers = {
+const syncHandlers = {
   testVoid: testVoid,
   testMapMap: testMapMap,
   testInsanity: testInsanity,
@@ -44,10 +43,10 @@
   return function(thing, result) {
     thing = syncHandlers[label](thing);
     result(null, thing);
-  }
+  };
 }
 
-var asyncHandlers = {
+const asyncHandlers = {
   testVoid: testVoidAsync,
   testMulti: testMultiAsync,
   testException: testExceptionAsync,
@@ -55,22 +54,22 @@
   testOneway: testOnewayAsync
 };
 
-var identityHandlers = [
-  'testString',
-  'testBool',
-  'testByte',
-  'testI32',
-  'testI64',
-  'testDouble',
-  'testBinary',
-  'testStruct',
-  'testNest',
-  'testMap',
-  'testStringMap',
-  'testSet',
-  'testList',
-  'testEnum',
-  'testTypedef'
+const identityHandlers = [
+  "testString",
+  "testBool",
+  "testByte",
+  "testI32",
+  "testI64",
+  "testDouble",
+  "testBinary",
+  "testStruct",
+  "testNest",
+  "testMap",
+  "testStringMap",
+  "testSet",
+  "testList",
+  "testEnum",
+  "testTypedef"
 ];
 
 function testVoid() {
@@ -81,13 +80,11 @@
   result(testVoid());
 }
 
-function testMapMap(hello) {
-  //console.log('testMapMap(' + hello + ')');
-
-  var mapmap = [];
-  var pos = [];
-  var neg = [];
-  for (var i = 1; i < 5; i++) {
+function testMapMap() {
+  const mapmap = [];
+  const pos = [];
+  const neg = [];
+  for (let i = 1; i < 5; i++) {
     pos[i] = i;
     neg[-i] = -i;
   }
@@ -102,16 +99,16 @@
   //console.log(argument);
   //console.log(')');
 
-  var first_map = [];
-  var second_map = [];
+  const first_map = [];
+  const second_map = [];
 
   first_map[ttypes.Numberz.TWO] = argument;
   first_map[ttypes.Numberz.THREE] = argument;
 
-  var looney = new ttypes.Insanity();
+  const looney = new ttypes.Insanity();
   second_map[ttypes.Numberz.SIX] = looney;
 
-  var insane = [];
+  const insane = [];
   insane[1] = first_map;
   insane[2] = second_map;
 
@@ -120,11 +117,11 @@
   return insane;
 }
 
-function testMulti(arg0, arg1, arg2, arg3, arg4, arg5) {
+function testMulti(arg0, arg1, arg2) {
   //console.log('testMulti()');
 
-  var hello = new ttypes.Xtruct();
-  hello.string_thing = 'Hello2';
+  const hello = new ttypes.Xtruct();
+  hello.string_thing = "Hello2";
   hello.byte_thing = arg0;
   hello.i32_thing = arg1;
   hello.i64_thing = arg2;
@@ -132,18 +129,18 @@
 }
 
 function testMultiAsync(arg0, arg1, arg2, arg3, arg4, arg5, result) {
-  var hello = testMulti(arg0, arg1, arg2, arg3, arg4, arg5);
+  const hello = testMulti(arg0, arg1, arg2, arg3, arg4, arg5);
   result(null, hello);
 }
 
 function testException(arg) {
   //console.log('testException('+arg+')');
-  if (arg === 'Xception') {
-    var x = new ttypes.Xception();
+  if (arg === "Xception") {
+    const x = new ttypes.Xception();
     x.errorCode = 1001;
     x.message = arg;
     throw x;
-  } else if (arg === 'TException') {
+  } else if (arg === "TException") {
     throw new TException(arg);
   } else {
     return;
@@ -152,12 +149,12 @@
 
 function testExceptionAsync(arg, result) {
   //console.log('testException('+arg+')');
-  if (arg === 'Xception') {
-    var x = new ttypes.Xception();
+  if (arg === "Xception") {
+    const x = new ttypes.Xception();
     x.errorCode = 1001;
     x.message = arg;
     result(x);
-  } else if (arg === 'TException') {
+  } else if (arg === "TException") {
     result(new TException(arg));
   } else {
     result(null);
@@ -166,49 +163,48 @@
 
 function testMultiException(arg0, arg1) {
   //console.log('testMultiException(' + arg0 + ', ' + arg1 + ')');
-  if (arg0 === ('Xception')) {
-    var x = new ttypes.Xception();
+  if (arg0 === "Xception") {
+    const x = new ttypes.Xception();
     x.errorCode = 1001;
-    x.message = 'This is an Xception';
+    x.message = "This is an Xception";
     throw x;
-  } else if (arg0 === ('Xception2')) {
-    var x2 = new ttypes.Xception2();
+  } else if (arg0 === "Xception2") {
+    const x2 = new ttypes.Xception2();
     x2.errorCode = 2002;
     x2.struct_thing = new ttypes.Xtruct();
-    x2.struct_thing.string_thing = 'This is an Xception2';
+    x2.struct_thing.string_thing = "This is an Xception2";
     throw x2;
   }
 
-  var res = new ttypes.Xtruct();
+  const res = new ttypes.Xtruct();
   res.string_thing = arg1;
   return res;
 }
 
 function testMultiExceptionAsync(arg0, arg1, result) {
   //console.log('testMultiException(' + arg0 + ', ' + arg1 + ')');
-  if (arg0 === ('Xception')) {
-    var x = new ttypes.Xception();
+  if (arg0 === "Xception") {
+    const x = new ttypes.Xception();
     x.errorCode = 1001;
-    x.message = 'This is an Xception';
+    x.message = "This is an Xception";
     result(x);
-  } else if (arg0 === ('Xception2')) {
-    var x2 = new ttypes.Xception2();
+  } else if (arg0 === "Xception2") {
+    const x2 = new ttypes.Xception2();
     x2.errorCode = 2002;
     x2.struct_thing = new ttypes.Xtruct();
-    x2.struct_thing.string_thing = 'This is an Xception2';
+    x2.struct_thing.string_thing = "This is an Xception2";
     result(x2);
   } else {
-    var res = new ttypes.Xtruct();
+    const res = new ttypes.Xtruct();
     res.string_thing = arg1;
     result(null, res);
   }
 }
 
-function testOneway(sleepFor) {
-  //console.log('testOneway(' + sleepFor + ') => JavaScript (like Rust) never sleeps!');
-}
+//console.log('testOneway(' + sleepFor + ') => JavaScript (like Rust) never sleeps!');
+function testOneway() {}
 
-function testOnewayAsync(sleepFor, result) {
+function testOnewayAsync(sleepFor) {
   testOneway(sleepFor);
 }
 
@@ -217,11 +213,8 @@
   asyncHandlers[label] = makeAsyncHandler(label);
 });
 
-['testMapMap', 'testInsanity'].forEach(function(label) {
+["testMapMap", "testInsanity"].forEach(function(label) {
   asyncHandlers[label] = makeAsyncHandler(label);
 });
 
 exports.ThriftTestHandler = asyncHandlers;
-
-exports.AsyncThriftTestHandler = asyncHandlers;
-exports.SyncThriftTestHandler = asyncHandlers;
