baidu-fanyi
v0.0.3
Published
baidu fanyi api on node.js
Downloads
11
Readme
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: '你好,世界'
})