Google 翻译 API Node.js 实现及命令行工具

本项目使用 Node.js 实现谷歌翻译 API,并提供命令行工具以方便翻译。

安装

npm install -g google-translate-cn-api

使用

翻译文本:

translate hello world

翻译并指定目标语言:

translate --to=cn hello world

翻译并指定源语言:

translate --from=en 你好,世界

管道或重定向翻译:

echo hello world | translate
cat some.txt | translate
zip 文件大小:11.64KB