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

translators

v1.0.4

Published

Translators is a library which aims to bring free, multiple, enjoyable translation to individuals and students in Nodejs.

Downloads

19

Readme

translators

Translators is a library which aims to bring free, multiple, enjoyable translation to individuals and students in Nodejs.

Translators是一个旨在为个人和学生带来免费、多样、愉快翻译的Nodejs库。

使用

安装

npm install translators

//or

yarn add translators

调用

const { baiduTranslator } = require('translators');

baiduTranslator('Space Force eyes lower-cost sensors to monitor geostationary orbit', 'en', 'zh', {}).then(value => {
     console.log(value);
 });

本项目目前支持的翻译接口包括

baiduTranslator: 百度通用翻译
googleTranslator: 谷歌单词模型翻译
youdaoTranslator: 有道翻译
bingTranslator: 微软必应翻译

参数

:param query_text: str, must.
:param from_language: str, default 'auto'.
:param to_language: str, default 'en'.
:param **kwargs:
        :param if_use_cn_host: boolean, default false.(如果是国内用户,检验设置为true,可以加快响应速度)
        :param if_ignore_limit_of_length: boolean, default false.
        :param is_detail_result: boolean, default false.
        :param timeout: int, default null.
        :param proxies: dict, default null.
        :param sleep_seconds: int, default `parseInt(Math.random()*10)`.
:return: str or list

说明

从小规模数据测试情况来看,百度通用翻译在中译英上表现较好,但在英译中上表现一般;谷歌单词模型翻译仅仅是功能演示,并不具备实际使用价值;有道翻译和微软必应翻译在中译英上表现相同,比百度通用翻译稍差一些,但在英译中表现上佳,有趣的是微软必应翻译在英译中上的效果居然和谷歌NMT模型效果一样,不知道是不是用的相同的模型。

个人推荐:有道翻译,毕竟是国内网站,在保证效果的同时也能够保证响应速度。

感谢

该项目来源于Python版本的Translators,在此对此项目表示感谢。

本项目仅限学习交流使用,请尊重各翻译提供商的商业利益。