baidu-fanyi
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

baidu-fanyi

baidu fanyi api on node.js

Usage

You can gain appid and key from baidu fanyi website.

import Translater from 'baidu-fanyi'

const trans = new Translater('Your Appid', 'Your Key')
trans.translate('hello world', { to: 'zh' })
  .then(data => {
    console.log(data) // output: '你好,世界'
  })

or CommandJS

const Translater = require('baidu-fanyi')

const trans = new Translater('Your Appid', 'Your Key')
trans.translate('こんにちは、世界', { to: 'zh' })
  .then(data => {
    console.log(data) // output: '你好,世界'
  })

Readme

Keywords

none

Package Sidebar

Install

npm i baidu-fanyi

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

9.12 kB

Total Files

9

Last publish

Collaborators

  • lckof