A Node.JS library to consume Google Translate API for free.
npm install @iamtraction/google-translate



bash
Stable version, from npm repository
npm install --save @iamtraction/google-translateLatest version, from GitHub repository
npm install --save iamtraction/google-translate
`Usage
`js
// If you've installed from npm, do:
const translate = require('@iamtraction/google-translate');// If you've installed from GitHub, do:
const translate = require('google-translate');
`#### Method:
translate(text, options)
`js
translate(text, options).then(console.log).catch(console.error);
`
| Parameter | Type | Optional | Default | Description |
|-|-|-|-|-|
| text | String | No | - | The text you want to translate. |
| options | Object | - | - | The options for translating. |
| options.from | String | Yes | 'auto' | The language name/ISO 639-1 code to translate from. If none is given, it will auto detect the source language. |
| options.to | String | Yes | 'en' | The language name/ISO 639-1 code to translate to. If none is given, it will translate to English. |
| options.raw | Boolean | Yes | false | If true, it will return the raw output that was received from Google Translate. |#### Returns:
Promise