google-translator-ts
v1.0.0
Published
Free Google Translator API for Node.js
Downloads
7
Maintainers
Readme
google-translator-ts

Introduction
This is a simple and easy to use package for translating text using Google Translate for Free. It is a TypeScript package and can be used in both TypeScript and JavaScript projects.
Installation
npm install google-translator-tsUsage
import { translator } from "google-translator-ts";
const source = "en"; // "" or "auto" for auto-detection
const target = "es";
const text = "Hello, how are you?";
translator(source, target, text)
.then((translation) => {
console.log("translation:", translation);
})
.catch((error) => {
console.error("error:", error);
});