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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aagames-fe/google-translate

v0.0.14

Published

### 使用前准备

Readme

谷歌翻译命令行工具

使用前准备

谷歌云SDK安装步骤(macos):

  • 第一步,安装homebrew:

打开官方网站查阅安装命令:The Missing Package Manager for macOS (or Linux) — Homebrew,或者复制下面的命令到终端执行:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

注意安装有可能出现网络错误,最好备有可用速度比较快的vpn

  • 第二步,安装谷歌sdk

终端输入命令 brew install --cask google-cloud-sdk 耐心等待安装完毕

  • 第三步,添加环境变量,请了解下终端程序(bash,zsh)、source命令、终端配置文件、环境变量相关知识点

输入命令brew info google-cloud-sdk 可以输入环境变量帮助信息。判断自身使用的是什么终端程序(bash、zshrc)复制添加到不同的配置文件。

bash配置文件:~/.bashrc zsh配置文件: ~/.zshrc

准备key.json

将目录的key.json放置到项目的根目录,或者在使用命令的使用利用 -k 参数传递绝对地址。

这个key.json是谷歌云的鉴权信息,收费账户。

安装

全局安装:npm i -g xxx

本地安装:npm i -D xxx

使用

  • text-translate 命令。这个命令是传入中文字符,然后自动翻译成对应语种到各自的语种文件中。

全局安装可以直接在终端内使用命令,本地安装需要安装npx模块,然后npx text-translate [options] 调用。

可以使用 -h 参数获取帮助。

  • translate 命令。这个命令是对整个目录的.vue文件进行分析,对未使用 $t 包裹的中文加上包裹,然后读取中文翻译。

全局安装可以直接在终端内使用命令,本地安装需要安装npx模块,然后npx text-translate [options] 调用。

可以使用 -h 参数获取帮助。