@deeplx/core
Version:
An unofficial but 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).
173 lines (130 loc) • 8.83 kB
Markdown
# @deeplx/core
[](https://github.com/un-ts/deeplx/actions/workflows/ci.yml?query=branch%3Amaster)
[](https://codecov.io/gh/un-ts/deeplx)
[](https://app.codacy.com/gh/un-ts/deeplx)
[](https://github.com/plantain-00/type-coverage)
[](https://coderabbit.ai)
[](https://www.npmjs.com/package/@deeplx/core)
[](https://github.com/un-ts/deeplx/releases)
[](https://conventionalcommits.org)
[](https://renovatebot.com)
[](https://standardjs.com)
[](https://github.com/prettier/prettier)
[](https://github.com/atlassian/changesets)
An unofficial but 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).
## TOC <!-- omit in toc -->
- [Online Service](#online-service)
- [Installation](#installation)
- [Usage](#usage)
- [Supported languages](#supported-languages)
- [Example 1](#example-1)
- [Example 2](#example-2)
- [Example 3](#example-3)
- [Sponsors and Backers](#sponsors-and-backers)
- [Sponsors](#sponsors)
- [Backers](#backers)
- [Changelog](#changelog)
- [License](#license)
## Online Service
<https://deeplx.1stg.me/translate>
## Installation
```sh
# npm
npm i @deeplx/core
# pnpm
pnpm add @deeplx/core
# yarn
yarn add @deeplx/core
```
## Usage
### Supported languages
Currently the following languages are supported:
| Abbreviation | Language | Writing in own language |
| ------------ | ------------------------ | ----------------------- |
| AR | Arabic | العربية |
| BG | Bulgarian | Български |
| CS | Czech | Česky |
| DA | Danish | Dansk |
| DE | German | Deutsch |
| EL | Greek | Ελληνικά |
| EN | English | English |
| EN-GB | English (British) | English (British) |
| EN-US | English (American) | English (American) |
| ES | Spanish | Español |
| ES-419 | Spanish (Latin American) | Español (Latinoamérica) |
| ET | Estonian | Eesti |
| FI | Finnish | Suomi |
| FR | French | Français |
| HE | Hebrew | עברית |
| HU | Hungarian | Magyar |
| ID | Indonesian | Bahasa Indonesia |
| IT | Italian | Italiano |
| JA | Japanese | 日本語 |
| KO | Korean | 한국어 |
| LT | Lithuanian | Lietuvių |
| LV | Latvian | Latviešu |
| NB | Norwegian Bokmål | Norsk bokmål |
| NL | Dutch | Nederlands |
| PL | Polish | Polski |
| PT | Portuguese | Português |
| PT-BR | Portuguese (Brazilian) | Português (Brasil) |
| PT-PT | Portuguese (European) | Português (Portugal) |
| RO | Romanian | Română |
| RU | Russian | Русский |
| SK | Slovak | Slovenčina |
| SL | Slovenian | Slovenščina |
| SV | Swedish | Svenska |
| TR | Turkish | Türkçe |
| UK | Ukrainian | Українська Мова |
| VI | Vietnamese | Tiếng Việt |
| ZH | Chinese | 中文 |
| ZH-HANS | Chinese (Simplified) | 简体中文 |
| ZH-HANT | Chinese (Traditional) | 繁体中文 |
You can either input the abbreviation or the language written in english.
### Example 1
This will translate a Chinese (`ZH`) text into Dutch (`NL`):
```js
import { translate } from '@deeplx/core'
await translate('你好', 'NL')
```
```log
'Hallo'
```
### Example 2
This will translate a `danish` text into `german`:
```js
import { translate } from '@deeplx/core'
await translate('Ring til mig!', 'german', 'danish')
```
```log
'Ruf mich an!'
```
### Example 3
This will translate a text using a proxy and a DeepL Pro session cookie:
```js
import { translate } from '@deeplx/core'
await translate('Hello World', 'ZH', 'EN', {
proxyUrl: 'http://127.0.0.1:7890',
dlSession: 'your_dl_session_cookie',
})
```
```log
'你好,世界'
```
## Sponsors and Backers
[](https://github.com/sponsors/JounQin)
### Sponsors
| 1stG | RxTS | UnTS |
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| [](https://opencollective.com/1stG) | [](https://opencollective.com/rxts) | [](https://opencollective.com/unts) |
### Backers
| 1stG | RxTS | UnTS |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [](https://opencollective.com/1stG) | [](https://opencollective.com/rxts) | [](https://opencollective.com/unts) |
## Changelog
Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).
## License
[MIT][] © [JounQin][]@[1stG.me][]
[1stG.me]: https://www.1stG.me
[JounQin]: https://github.com/JounQin
[MIT]: http://opensource.org/licenses/MIT