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

baidu-translate-api

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baidu-translate-api

A free and unlimited API for Baidu Translate

  • 0.4.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-70.83%
Maintainers
1
Weekly downloads
 
Created
Source

baidu-translate-api npm

A free and unlimited API for Baidu Translate

Translations

  • 中文

Install

npm install --save baidu-translate-api 

or

yarn add baidu-translate-api

Usage

const translate = require("baidu-translate-api");

translate("让我们来翻译吧!").then(res => {
    console.log(res.trans_result.dst);
    // Let's translate it!
});

API

translate(query, options)

query

Type: String

The text to be translated

options

Type: Object

  • from

    Type: String Default: auto

    The language in which the query text or auto. Contain in Languages

  • to

    Type: String Default: en

    The language in which the text should be translated. Contain in Languages

  • requestOpts

    Type: RequestOptions Default: {}

    reference request options

Returns an object:

  • from - The lanuage in which the query text.

  • to

  • trans_result (object)

    • dst - The translation
    • src - The source (equal to query)

setGlobalConfig(config)

namedesc
useLocalStorestore the token config in memory. default: false.

Languages

abbrname
autoAutomatic detection
zhChinese
enEnglish
yueCantonese
wywClassical Chinese
jpJapanese
korKorean
fraFrench
spaSpanish
thThai
araArabic
ruRussian
ptPortuguese
deGerman
itItalian
elGreek language
nlDutch
plPolish
bulBulgarian
estEstonian
danDanish
finFinnish
csCzech
romRomanian
sloSlovenia
sweSwedish
huHungarian
chtTraditional Chinese
vieVietnamese

AFTERWORD

If this repo helped you, give me a star and it's the greatest encouragement to me.

Keywords

FAQs

Package last updated on 18 Sep 2020

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