4.0.2 • Published 2 months ago

@kreisler/js-google-translate-free v4.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

JS Google Translate Free + Typescript 🚀

Simple JS library for talking to Google's Translate API for free.

Eliminates IP request limitations

List of supported languages

https://cloud.google.com/translate/docs/languages

Usage

Install package

npm i @kreisler/js-google-translate-free

Import module

import JsGoogleTranslateFree from "@kreisler/js-google-translate-free";

or

Import commonjs

const JsGoogleTranslateFree = require("@kreisler/js-google-translate-free");

Example #1

(async () => {
  try {
    const from = "es";
    const to = "en";
    const text = "buenos días";
    const translation = await JsGoogleTranslateFree.translate({ from, to, text });
    console.log(translation); // Good morning
  } catch (error) {
    console.error(error);
  }
})();

Example #2

(async () => {
  try {
    // const from = "en"; optional default is "auto"
    const to = "es";
    const text = "Good morning";
    const translation = await JsGoogleTranslateFree.translate({ to, text });
    console.log(translation); // Buenos días
  } catch (error) {
    console.error(error);
  }
})();
3.3.4

2 months ago

3.3.3

2 months ago

3.0.0

2 months ago

4.0.1

2 months ago

4.0.0

2 months ago

4.0.2

2 months ago

2.1.0

12 months ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago