🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

text-translator

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-translator

## Installation

latest
npmnpm
Version
1.0.12
Version published
Weekly downloads
14
600%
Maintainers
1
Weekly downloads
 
Created
Source

#Language Translator

Installation

npm i text-translator

Configuration

Currently AWS Translate API is supported for this package. In future, there will be more packages like this.

You need to set environment variables:

AWS_ACCESS_KEY=<your-aws-access-key>

AWS_SECRET_KEY=<your-aws-secret-key>

REGION=<your-aws-region> (default is us-east-1)

Basic Usage

import { LanguageTranslateService } from 'text-translator';
const translate = new LanguageTranslateService();
translate.translate('<h1>Hi, how are you</h1>', 'fr', TextType.HTML,  TranslateProvider.AWS).then(translatedText => {
    console.log('Translated Text', translatedText);
});

The text type supports Plain text, Html and markdown text types.

FAQs

Package last updated on 23 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts