Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
yandex-cloud-translate
Advanced tools
Translate text with Yandex Cloud AI API
Install my-project with npm
npm i yandex-cloud-translate
or
yarn add yandex-cloud-translate
import { Yandex } from 'yandex-cloud-translate';
const config = {
YC_OAUTH_TOKEN = 'token', // https://cloud.yandex.com/en-ru/docs/iam/concepts/authorization/oauth-token
YC_FOLDER_ID = 'folder_id' // https://cloud.yandex.com/en-ru/docs/resource-manager/operations/folder/get-id
}
const Ya = new Yandex(config);
or if you have valid process.env, just create in .env file YC_OAUTH_TOKEN and YC_FOLDER_ID
import { Yandex } from 'yandex-cloud-translate';
const Ya = new Yandex();
const translated = await Ya.translate({
to: 'fr',
from: 'en', // or don`t set to auto
texts: ['text one', 'text two'], // or texts: 'text one'. string, or array of strings
format: 'text', // or 'html'. default: 'text'
});
//
interface ITranslateConfig {
texts: string | string[]; // if a string - result will be a string, if array of strings - array of strings
to: string; // ISO ru, en, fr ... etc
from?: string | null; // ISO ru, en, fr ... etc
format?: 'text' | 'html';
}
FAQs
Translate text with Yandex Cloud AI API
The npm package yandex-cloud-translate receives a total of 1 weekly downloads. As such, yandex-cloud-translate popularity was classified as not popular.
We found that yandex-cloud-translate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.