Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@toil/translate

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toil/translate

A library for free and not only using various translation APIs

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
66
decreased by-46.34%
Maintainers
0
Weekly downloads
 
Created
Source

translate

GitHub Actions npm ru en

A library for free and not only using various translation APIs, which supports working with JavaScript, TypeScript, and also has built-in separated types for Typebox.

Installation

Installation via Bun:

bun add @toil/translate

Installation via NPM:

npm install @toil/translate

Getting started

To start working with the API, you need to create a Translation Client. This can be done using the code provided below.

const client = new TranslationClient({
  service: TranslationService.yandexbrowser,
});

const translatedResult = await client.translate(
  "The quick brown fox jumps over the lazy dog",
);

const detectResult = await client.detect(
  "The quick brown fox jumps over the lazy dog",
);

const langs = await client.getLangs(
  "The quick brown fox jumps over the lazy dog",
);

You can see more code examples here

Available services

StatusServiceFunctionsLimits
YandexBrowserTranslate
Detect
GetLangs
10k chars/req
10k chars/req
YandexCloudTranslate
Detect
GetLangs
2k chars/req
1k chars/req
YandexTranslateTranslate
Detect
GetLangs
10k chars/req
10k chars/req
MSEdgeTranslate
Detect
GetLangs
50k chars/req
50k chars/req

Build

To build, you must have:

  • Bun

Don't forget to install the dependencies:

bun install
Regular Build

Building the entire package:

bun build:bun
Building a types for TypeBox

You can use this build option if you only want to build types for TypeBox:

bun build:typebox

Tests

The library has minimal test coverage to check it's performance.

Run the tests:

bun test

Keywords

FAQs

Package last updated on 20 Oct 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc