THRIFT-5811: Update eslint & prettier
Client: js
Patch: Cameron Martin
This closes #3087
diff --git a/tutorial/nodejs/NodeClient.js b/tutorial/nodejs/NodeClient.js
index b4886e8..e4e92cc 100644
--- a/tutorial/nodejs/NodeClient.js
+++ b/tutorial/nodejs/NodeClient.js
@@ -17,47 +17,44 @@
* under the License.
*/
-var thrift = require('thrift');
-var Calculator = require('./gen-nodejs/Calculator');
-var ttypes = require('./gen-nodejs/tutorial_types');
-const assert = require('assert');
+var thrift = require("thrift");
+var Calculator = require("./gen-nodejs/Calculator");
+var ttypes = require("./gen-nodejs/tutorial_types");
+const assert = require("assert");
var transport = thrift.TBufferedTransport;
var protocol = thrift.TBinaryProtocol;
var connection = thrift.createConnection("localhost", 9090, {
- transport : transport,
- protocol : protocol
+ transport: transport,
+ protocol: protocol,
});
-connection.on('error', function(err) {
+connection.on("error", function (err) {
assert(false, err);
});
// Create a Calculator client with the connection
var client = thrift.createClient(Calculator, connection);
-
-client.ping(function(err, response) {
- console.log('ping()');
+client.ping(function (err, response) {
+ console.log("ping()");
});
-
-client.add(1,1, function(err, response) {
+client.add(1, 1, function (err, response) {
console.log("1+1=" + response);
});
-
work = new ttypes.Work();
work.op = ttypes.Operation.DIVIDE;
work.num1 = 1;
work.num2 = 0;
-client.calculate(1, work, function(err, message) {
+client.calculate(1, work, function (err, message) {
if (err) {
console.log("InvalidOperation " + err);
} else {
- console.log('Whoa? You know how to divide by zero?');
+ console.log("Whoa? You know how to divide by zero?");
}
});
@@ -65,11 +62,11 @@
work.num1 = 15;
work.num2 = 10;
-client.calculate(1, work, function(err, message) {
- console.log('15-10=' + message);
+client.calculate(1, work, function (err, message) {
+ console.log("15-10=" + message);
- client.getStruct(1, function(err, message){
- console.log('Check log: ' + message.value);
+ client.getStruct(1, function (err, message) {
+ console.log("Check log: " + message.value);
//close the connection once we're done
connection.end();