# googleapi-translate

> To use google translate api

Latest version **1.0.3** (published 2023-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install googleapi-translate
pnpm add googleapi-translate
yarn add googleapi-translate
bun add googleapi-translate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-06-17 |
| First published | 2023-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Wai Thaw Oo |
| Maintainers | waithawoo |
| Keywords | googletranslate, google, translate, api, translate api |

## Links

- npm: https://www.npmjs.com/package/googleapi-translate
- Repository: https://github.com/waithawoo/node-googleapi-translate
- Homepage: https://github.com/waithawoo/node-googleapi-translate#readme
- Issues: https://github.com/waithawoo/node-googleapi-translate/issues
- npm.io page: https://npm.io/package/googleapi-translate

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.3 (latest) — 2023-06-17
- 1.0.2 — 2023-06-17
- 1.0.1 — 2023-06-16

## README

# Node Google API Translation

## To translate languages with Google Translation API V2

- **[Installation](#installation)**
- **[Usage](#usage)**

## Installation
Install this package via [npm](https://npmjs.com/).

```
npm install googleapi-translate
```

## Usage
- import the package and create a new object by passing token 
```
let googleApi = require("googleapi-translate")

let googleTranslation = new googleApi({token: 'this is token'})
```
- default hostname is ''translation.googleapis.com'' and you can also pass hostname like this :
```
let googleTranslation = new googleApi({token: 'this is token', hostname: 'this is hostname'})
```
### Translate
```
googleTranslation.translate("hello", "en", "ja").then((res)=>{
    console.log(res);
})
```

### Detect the language
```
googleTranslation.detect("hello").then((res)=>{
    console.log(res);
})
```
### Get supported languages
```
googleTranslation.getLanguages().then((res)=>{
    console.log(res);
})
```
## Security

If you discover any security related issues, please email them to [waithawoocw@gmail.com](mailto:waithawoocw@gmail.com) instead of using the issue tracker.

## License

The MIT License (MIT). Please see the [License File](LICENSE) for more information.

---
_Source: https://npm.io/package/googleapi-translate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
