Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

google-translation

seouldeveloper17MIT0.0.6

google translate module

google, translate, translator, translation

readme

google-translate

Just Google translator module for node.js

Installation

$ npm install google-translation

API

var authObj = {
  apiKey: GOOGLE_TRANSLATE_API_KEY,
  jwtEmail: GOOGLE_SERVICE_ACCOUNT_EMAIL,
  jwtKey: GOOGLE_SERIVCE_ACCOUNT_PRIVATE_KEY
};
var translator = require('google-translation.js').init(GOOGLE_TRANSLATE_API_KEY);
var obj = {
    text: '독도는 대한민국 영토 입니다.'
    target: 'en',
    model: 'nmt' // enum nmt|smt
};
translator.translate(obj, function(err, res) {
  console.log(err, res);
});

Reference

Please refer to this link for the more information.