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

what-is-x

v0.6.12

Published

a terminal translation tool

Downloads

25

Readme

whats 🔍

一个作者本人也经常用的命令行翻译工具🤓

Inspired by afc163/fanyi, but more

⭐️Features

  • 中英日文基本词语互译
  • 小语种中文翻译
  • 支持语言范围内的长句翻译
  • 文本关键字高亮
  • 中英文语音播放
  • 终端自适应的输出
  • 支持查询记录

💾Install

npm install -g what-is-x

🚨注意

💡Usage

Usage: whats <query> [options]

Options:
  -v, --vers                      output the current version
  -h, --help                      output usage information
  -f, --from        <source>      the source language to translate
  -t, --to          <target>      the target language
  -n, --normal                    normalize text color in your terminal
  -s, --say                       use default system voice and speak
  -r, --record   [limit | clear]  show the query record (limit records ouputs default: 6 or clear records)

Examples:
  $ whats love
  $ whats bonjour -f fr
  $ whats こんにちは -f ja -t en
  $ whats I love you very much
  $ whats -r clear // 清除查询记录
  $ whats -r 10    // 限制查询结果数量

🇨🇳支持语言

语言|目标语言| ---|:--:| 中文|英文、日文、韩文、法文、西班牙文、葡萄牙文、俄文、越南文、德文、阿拉伯文、印尼文、意大利文 英文|中文、日文 日文|中文、英文 韩文|中文 法文|中文 西班牙文|中文 葡萄牙文|中文 意大利文|中文 俄文|中文 越南文|中文 德文|中文 阿拉伯文|中文 印尼文|中文 意大利文|中文

🇺🇳各语言对应代码

语言|代码| ---|:--:| 中文|zh-CHS 英文|en 日文|ja 韩文|ko 法文|fr 西班牙文|es 葡萄牙文|pt 意大利文|it 俄文|ru 越南文|vi 德文|de 阿拉伯文|ar 印尼文|id

💬Notes

  1. 你的 Node 版本需 ≥ 7.6.0

  2. 本翻译工具拥有终端自适应的输出,即超过终端宽度的输出会被切分并排版, 例句的输出不会溢出终端窗口。一般情况下想要看到全部的例句建议的终端窗口大小最少为 73 * 25

  3. 不要混用全角和半角符号,这会让程序难以判断句子的切分位置从而导致排版畸形的输出结果

  4. 测试版本目前支持基本词语的互译、小语种中文翻译、长句子翻译(中文字符数 > 4 将被视为句子)

  5. 输出结果的文本颜色可能会因你的终端主题而有较大差异, 想要消除颜色带来的影响(无颜色输出)可以使用 -n--normal 命令。 例如:

    $ whats up --normal
  6. 中英文互译外所有语言的翻译必须使用 -f--from 标识源语言

  7. 在支持语言范围内,若无 -t--to 命令标识,目标语言默认为中文

  8. 使用语音播放 -s--say 时,可能会存在系统层次的问题,具体参考👉say.js

🚨关于 v0.4.6 及以上版本说明

由于 MacOS 自 10.11 系统开始使用了 Rootless 机制,系统默认将会锁定 /system、/bin、/usr 这三个目录, 因此全局环境下无法获取数据库读写权限,需要在终端输入如下命令:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

📄License

MIT.