Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ding-trans

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ding-trans - npm Package Compare versions

Comparing version 1.0.41 to 1.0.42

15

bin/translate.js
#! /usr/bin/env node
require("colors");

@@ -7,4 +6,8 @@ const say = require("say");

const argv = require("yargs").argv;
let queryStr = encodeURI(argv._.join(" "));
// 对驼峰的连续单词进行分割后转义
let queryStr = encodeURI(
argv._.join(" ")
.replace(/([A-Z])/g, " $1")
.toLowerCase()
);
// 无参数,或帮助

@@ -30,8 +33,5 @@ if (!queryStr || argv.help == true || argv.H == true || argv.h == true) {

}
// 对驼峰的连续单词进行分割后转义
// queryStr = encodeURI(queryStr.replace(/([A-Z])/g, " $1").toLowerCase());
//查词
sendInfo(queryStr);
}
//格式化

@@ -68,3 +68,2 @@ function format(json) {

}
//发送请求

@@ -74,3 +73,2 @@ function sendInfo(query) {

let http = require("http");
// 1.用于请求的选项

@@ -85,3 +83,2 @@ let options = {

// let options = ` http://aidemo.youdao.com/trans?q=${query}&&from=Auto&&to=Auto`;
// 处理响应的回调函数

@@ -88,0 +85,0 @@ let callback = function (response) {

2

package.json
{
"name": "ding-trans",
"version": "1.0.41",
"version": "1.0.42",
"description": "a translation cli",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc