npm.io
0.4.0 • Published 3d agoCLI

deeplx

Licence
MIT
Version
0.4.0
Deps
2
Size
11 kB
Vulns
0
Weekly
65
Stars
187

DeepLX

GitHub Actions Workflow Status Codecov Codacy Grade type-coverage CodeRabbit Pull Request Reviews npm GitHub Release

Conventional Commits Renovate enabled JavaScript Style Guide Code Style: Prettier changesets

All in one for @deeplx/core and @deeplx/cli, a powerful and easy-to-use yet free DeepL API client for Node.js using DeepL by porting OwO-Network/DeepLX.

TOC

Online Service

https://deeplx.vercel.app/translate

Installation

# npm
npm i deeplx

# pnpm
pnpm add deeplx

# yarn
yarn add deeplx

# or install `@deeplx/core` for only API usage, or install `@deeplx/cli` for only CLI usage

Usage

Supported languages

Currently the following languages are supported:

Abbreviation Language Writing in own language
BG Bulgarian Български
ZH Chinese 中文
CS Czech Česky
DA Danish Dansk
NL Dutch Nederlands
EN English English
ET Estonian Eesti
FI Finnish Suomi
FR French Français
DE German Deutsch
EL Greek Ελληνικά
HU Hungarian Magyar
IT Italian Italiano
JA Japanese 日本語
LV Latvian Latviešu
LT Lithuanian Lietuvių
PL Polish Polski
PT Portuguese Português
RO Romanian Română
RU Russian Русский
SK Slovak Slovenčina
SL Slovenian Slovenščina
ES Spanish Español
SV Swedish Svenska
UK Ukrainian Українська Мова

You can either input the abbreviation or the language written in english.

Command line tool
Help
deeplx -h
Usage: deeplx [options]

The cli for
[\`@deeplx/core\`](https://github.com/un-ts/deeplx/blob/master/packages/@deeplx/core),
a powerful and easy-to-use yet free DeepL API client for Node.js using
[DeepL](https://www.deepl.com) by porting
[OwO-Network/DeepLX](https://github.com/OwO-Network/DeepLX).

Options:
  -V, --version          output the version number
  -s, --source <text>    Source language of your text
  -t, --target <text>    Target language of your desired text
  --text <text>          Text to be translated
  -f, --file <path>      File to be translated
  --dl-session <cookie>  DeepL Pro session cookie (dl_session)
  --proxy <url>          Proxy URL for the request
  -h, --help             display help for command
Example 1

This will translate a Spanish (ES) text into Russian (RU):

deeplx -t russian --text "¡Buenos días!"
Доброе утро!
Example 2

This will translate the file (test.txt) text from Italian (IT) into Portuguese (PT):

deeplx -t PT -f test.txt
Node library
Example 1

This will translate a Chinese (ZH) text into Dutch (NL):

import { translate } from 'deeplx'

await translate('你好', 'NL')
'Hallo'
Example 2

This will translate a danish text into german:

import { translate } from 'deeplx'

await translate('Ring til mig!', 'german', 'danish')
'Ruf mich an!'
Example 3

This will translate a text using a proxy and a DeepL Pro session cookie:

import { translate } from 'deeplx'

await translate('Hello World', 'ZH', 'EN', {
  proxyUrl: 'http://127.0.0.1:7890',
  dlSession: 'your_dl_session_cookie',
})
'你好,世界'

Sponsors and Backers

Sponsors and Backers

Sponsors
1stG RxTS UnTS
1stG Open Collective sponsors RxTS Open Collective sponsors UnTS Open Collective sponsors
Backers
1stG RxTS UnTS
1stG Open Collective backers RxTS Open Collective backers UnTS Open Collective backers

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

MIT JounQin@1stG.me

Keywords