1.0.0 • Published 7 years ago

yandex-translate-api-wrapper v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

yandex-translate-api-wrapper

A simple wrapper of the Yandex's translation API.

Install

$ npm install yandex-translate-api-wrapper --save

Usage

translateApi.getLanguageList(apiKey);
//=> return the list of supported languages

apiWrapper.translateText(apiKey, supportedLanguage, text);
//=> return translation

Example

const translateApi = require('yandex-translate-api-wrapper')
const apiKey = 'xxxxxxx'
const languageList = translateApi.getLanguageList(apiKey);
//=> {"dirs":["az-ru","be-bg"...]}

const translation = translateApi.translateText(apiKey, 'es-en', 'Hola');
//=> {"code":200,"lang":"es-en","text":["Hello"]}

License

MIT © Tommytrg.

1.0.0

7 years ago