I created this package, and would like to share. You can see at Baidut on NPM
Example usage
var Baidut = require("Baidut");
Baidut.builder
.setAppId("2015063000000001")
.setKey("12345678")
.build();
Baidut.translate('สวัสดี', { http_request: true, get_method: true, from_lang: "th", to_lang: "en" })
.then((result) => {
console.log("translated text: " + result.trans_result[0].dst);
}, (e) => {
console.log(e.code + ": " + e.message);
});
Thank you :)