开发并发布一个健壮的 npm 包:https://mp.weixin.qq.com/s/RE0EWyAHep5fKc_6XRJ7bw
Github: https://github.com/liuxing/translator-cli
Npm: https://www.npmjs.com/package/translator-cli
- 编码风格:editorconfig
- 代码风格:JavaScript Standard Style
- 测试:jest
- CI: Travis CI
主要使用了 commander superagent xml2js chalk
主要功能:
- 支持 iciba、有道翻译
- 快速切换翻译源
使用方法
$ npm install -g translator-cli
$ translator
Usage: translator [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
query <words> Query words
ls List all the source
use Change source to source
Examples
$ translator query test # fanyi query test
test [ test ] ~ fanyi.youdao.com
- n. 试验;检验
- vt. 试验;测试
- vi. 试验;测试
- n. (Test)人名;(英)特斯特
1. Test
测试,测验,检验
2. Test Drive
Test Drive,Test Drive,无限狂飙
3. Test Engineer
测试员,测试工程师,软件测试工程师