npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

terminal-translate

v1.0.6

Published

a tearmail-translate tool!

Downloads

19

Readme

terminal-translate

build build download

NPM

命令行翻译工具,三大翻译引擎支持!

命令行英文报错怎么办?复制报错内容, tl一下即可!

一些注意事项

百度翻译引擎限制: 200W字符/月

有道翻译引擎限制: 1000次请求/时,申请了四个key,4000次请求/时

爱词霸翻译引擎限制: 无限制

当百度翻译引擎和有道翻译引擎的资源耗尽报错时,请使用tl -e iciba切换爱词霸翻译引擎!

如果使用量大,请自行申请API并更换配置文件中的key

翻译引擎支持

  • [x] 百度翻译 - 支持多单词、多句子、单词句子混合翻译, 语言翻译方向最多, tl -l查看支持翻译语言
  • [x] 有道翻译 - 只支持单句子或单词互译,
  • [x] 爱词霸翻译 - 只支持单词或者短语翻译

工具默认使用有道翻译

...持续添加中

安装

npm install terminal-translate -g

帮助

指令tl 或者 translate

tl -h 查看帮助菜单

  Usage: translate
  a tearmail-transtalte tool!
  GithubID: ShanaMaid
  Repository: https://github.com/ShanaMaid/terminal-translate.git

  Options:

    -h, --help               output usage information
    -v, --version            show version
    -f, --baidu-from <from>  baidu engine: from language, default: auto
    -t, --baidu-to <to>      baidu engine: to language, default: zh
    -l, --baidu-language     baidu engine language
    -e, --engine <to>        change translate engine
    -c, --config             show config.json

使用手册

百度翻译引擎

百度翻译引擎默认翻译结果为中文

单纯需要了解单词或句子意思建议使用百度翻译,同时百度翻译支持多单词、多句子、单词句子混合翻译!

切换翻译引擎为百度翻译输入以下指令

tl -e baidu

修改百度翻译引擎语言翻译结果为英语,翻译结果不能修改auto

tl -t en

修改百度翻译引擎语言翻译起始语言为中文(不建议修改,默认值为auto,会自动检测)

tl -f zh

查看百度翻译引擎支持的语言翻译列表

tl -l

单个单词翻译

tl word

多个单词以空格分隔

tl apple book

句子翻译请以双引号包裹

tl "I love you, baby!"

单词句子混合同时翻译

tl apple book "I love you, baby!"

混合翻译

有道翻译引擎

有道翻译引擎适合用于学习了解单词意思,只支持单个单词或句子翻译,多个单词翻译会把单词集合判断为句子,句子翻译时无须像百度引擎一样用双引号包裹!

任何输入任何非中文的语言均会被翻译成中文,如果中文输入则会被翻译成英文

切换翻译引擎为有道翻译输入以下指令

tl -e youdao

单个单词翻译结果

句子翻译结果

中文句子翻译结果

爱词霸翻译引擎

切换爱词霸翻译引擎

tl -e iciba

爱词霸翻译引擎属于词典翻译,支持单个单词或者单词短语翻译,句子翻译时会报错!

  iciba can't translate sentences! 
  please use youdao or baidu!

版本更新记录

v1.0.4 翻译结果支持彩色显示,更加显眼瞩目

v1.0.3 支持爱词霸翻译引擎,新增3个有道翻译key

v1.0.2 支持有道翻译引擎,修复一些BUG

v1.0.1 支持百度翻译引擎

v1.0.0 发布

支持

如果工具有任何BUG或者你想提出改进建议,请提issue!

如果你对此工具非常满意不妨star或者打赏我请我喝一瓶脉动

声明

单词翻译结果样式参照了@偏右fanyi