ding-trans
Advanced tools
Comparing version 1.0.33 to 1.0.34
@@ -15,13 +15,10 @@ #! /usr/bin/env node | ||
//======================================================= | ||
let argv = require("yargs").argv, | ||
queryStr = encodeURI(argv._.join(" ")), | ||
read = argv.r || argv.read; | ||
if (!queryStr) { | ||
console.log("word or sentence required..."); | ||
} else { | ||
// console.log(argv); | ||
console.log("播放中...".green); | ||
if (argv.say == true || argv.S == true) { | ||
console.log("播放中...".green); | ||
say.speak(querystring.unescape(queryStr)); | ||
@@ -32,11 +29,6 @@ return; | ||
} | ||
if (read) { | ||
console.log("waiting for the new function..."); | ||
} | ||
function format(json) { | ||
// console.log("\n"); | ||
// console.log(JSON.parse(json), "\n"); | ||
let data = JSON.parse(json), | ||
@@ -51,7 +43,5 @@ pronTitle = "发音:", | ||
template = ""; | ||
let basic = data.basic, | ||
web = data.web, | ||
translation = data.translation; | ||
if (basic ? basic : "") { | ||
@@ -62,3 +52,2 @@ for (let i = 0; i < basic.explains.length; i++) { | ||
} | ||
if (web ? web : "") { | ||
@@ -75,3 +64,2 @@ for (let i = 0; i < web.length; i++) { | ||
} | ||
translation ? (machineTrans = translation) : false; | ||
@@ -90,3 +78,2 @@ template = | ||
machineTrans; | ||
console.log(template); | ||
@@ -115,3 +102,2 @@ } | ||
}); | ||
response.on("end", function () { | ||
@@ -118,0 +104,0 @@ // 数据接收完成 |
{ | ||
"name": "ding-trans", | ||
"version": "1.0.33", | ||
"version": "1.0.34", | ||
"description": "a translation cli", | ||
@@ -20,5 +20,4 @@ "main": "index.js", | ||
"colors": "^1.4.0", | ||
"say": "^0.16.0", | ||
"yargs": "^17.0.1" | ||
} | ||
} |
2
4559
100
- Removedsay@^0.16.0
- Removedone-time@0.0.4(transitive)
- Removedsay@0.16.0(transitive)