@imshawan/gslate

1.2.0 • Public • Published

Google Translator API

npm npm license

An open-source javascript library for your NodeJS projects that enables speech translation. Inspired from goslate.

Install via npm

$ npm install --save @imshawan/gslate

Usage

Translator.Translate(param1, param2, param3 [optional] )
  • param1 String (Your query)
  • param2 String (Translation language)
  • param3 String (From Language), Default: auto
  • Returns a promise based object

Note: Keep the param3 (from Language) as auto, in order to auto-detect your query language

Example

const Translator = require( '@imshawan/gslate' )
Translator.Translate("Hello", "hi") // "hi" is the language code for Hindi
        .then((response) => {
            console.log(response)
        })

Languages Help

This method will help you in getting all the languages that are supported along with their language code in JSON format.

Example

const Translator = require( '@imshawan/gslate' )
Translator.getLanguages()
        .then((response) => {
            console.log(response)
        })

About

Copyright (c) 2021 Shawan Mandal.

Package Sidebar

Install

npm i @imshawan/gslate

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

5.48 kB

Total Files

6

Last publish

Collaborators

  • imshawan