const translate = require('translate');
translate.engine = 'google';
translate.key = 'AIzaSyAVlT0X3UVlYXvwIBbsDrZGic2SuK1SB4Q';
translate('Hello world', { to: 'ru', engine: 'google', key: 'AIzaSyAVlT0X3UVlYXvwIBbsDrZGic2SuK1SB4Q' }).then(text => {
console.log(text); // Hola mundo
});