google-translator-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

google-translator-ts

dt l min types v

npm

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-ts

Usage

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);
 });

/google-translator-ts/

    Package Sidebar

    Install

    npm i google-translator-ts

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • umairshabbir