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

xtranslator

v1.3.1

Published

## 简介(introduction)

Downloads

366

Readme

xTranslator

简介(introduction)

聚合翻译 api

安装(installation)

npm i xtranslator

使用

建立新翻译器

import xtranslator from "xtranslator";

const chatgpt = xtranslator.es.chatgpt();

chatgpt.setKeys({
    key: "sk-***",
});
console.log(await chatgpt.run("hi", "auto", "zh")); // 你好
console.log(await chatgpt.run(["what can i say", "see you again"], "auto", "zh")); // ["我能说什么","再次见到你"]
<script src="./dist/xtranslator.umd.js"></script>
<script></script>

引擎

引擎支持:

  • [x] 百度
  • [x] 有道
  • [x] 必应
  • [x] 彩云
  • [x] deepl
  • [x] deeplx
  • [x] chatgpt(ollama) 可自定义提示词
  • [x] gemini 可自定义提示词
  • [x] 小牛
  • [x] 腾讯交互式
  • [x] 腾讯
  • [x] 火山
  • [x] 谷歌(免费)
  • [x] Yandex(免费)

语言代码

使用 ISO 639 标准,语言优先,比如简体中文使用zh-hans而不是zh-cn

可以使用lan targetLan属性获取引擎支持的语言代码

使用Intl.DisplayNames获取代码的自然语言名称,导出的language.languagesNotInIntl是不支持转换的代码,需要自己处理国际化

使用时可以不用考虑语言代码大小写,提供了自动匹配:区域转文字(zh-cn->zh-hans)、模糊匹配(zh-unknown->zh如果支持zhzh-unknown->zh-hans