@jswork/next-baidu-fanyi

1.0.2 • Public • Published

next-baidu-fanyi

Baidu fangyi api wrapper.

version license size download

installation

npm install -S @jswork/next-baidu-fanyi

apis

api params description
translate - Get translation

options

name default description
delay 1000 Call fn duration.
from zh from which language
to en to which language
appid - -
secret - -
q - keywords

usage

import NxBaiduFanyi from '@jswork/next-baidu-fanyi';

// code goes here:
NxBaiduFanyi.translate({ q: '苹果', from:'zh', to:'en' }).then((res) => {
  /*
  // res:
  {
    from: 'zh',
    to: 'en',
    trans_result: [{ src: '苹果', dst: 'Apple' }]
  }
  */
});

resources

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/next-baidu-fanyi

Homepage

js.work

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

7.9 kB

Total Files

6

Last publish

Collaborators

  • afeiship