json-excel-cli
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -19,7 +19,8 @@ #!/usr/bin/env node | ||
console.log( | ||
chalk.blueBright(`Support two mode: | ||
chalk.magentaBright(`Support two mode: | ||
1. convert language json file to excel file, Example call: | ||
json2excel ../zh-cn.json ../en.json helloworld.xlsx | ||
${chalk.yellow("json2excel <../zh-cn.json> <../en.json> [helloworld.xlsx]")} | ||
2. convert excel file to language json file, Example call: | ||
json2excel -r ../helloworld.xlsx | ||
${chalk.yellow("json2excel -r <../helloworld.xlsx> [helloworld]")} | ||
PS:<>表示必填,[]表示选填 | ||
`) | ||
@@ -38,3 +39,3 @@ ); | ||
const jsonArr = excel2json(process.cwd(), convertRelativePath(process.cwd(), String.raw`${args.r}`)); | ||
writeToFile(process.cwd(), json2FormatLangObj(jsonArr[0]), cmd[0] || "after"); | ||
writeToFile(process.cwd(), json2FormatLangObj(jsonArr[0]), cmd[0] || "helloworld"); | ||
spinner.succeed("处理完成\r\n"); // 加载状态 => 成功状态 | ||
@@ -46,3 +47,3 @@ } else if (!args.r && [2, 3].includes(cmd.length)) { | ||
let enJSON = require(convertRelativePath(__dirname, String.raw`${cmd[1]}`)); | ||
json2excel(process.cwd(), zhJSON, enJSON, cmd[2] || "HelloWorld.xlsx"); | ||
json2excel(process.cwd(), zhJSON, enJSON, cmd[2] || "helloworld.xlsx"); | ||
spinner.succeed("处理完成"); // 加载状态 => 成功状态 | ||
@@ -49,0 +50,0 @@ } else { |
{ | ||
"name": "json-excel-cli", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
46975
891