@zeng_x_pang/cli 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # @zeng_x_pang/cli
2
+
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 支持了除法
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @zeng_x_pang/core@1.1.0
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from "commander";
2
+ import { add, devide, minus } from "@zeng_x_pang/core";
3
3
  import chalk from "chalk";
4
- import { add, minus } from "@zeng_x_pang/core";
4
+ import { Command } from "commander";
5
5
  const program = new Command();
6
6
  program.name("num-cli").description("计算数字加减").version("0.0.1");
7
7
  program
@@ -20,4 +20,12 @@ program
20
20
  .action((a, b) => {
21
21
  console.log(chalk.cyan(minus(+a, +b)));
22
22
  });
23
+ program
24
+ .command("devide")
25
+ .description("除法")
26
+ .argument("a", "第一个数字")
27
+ .argument("b", "第二个数字")
28
+ .action((a, b) => {
29
+ console.log(chalk.cyan(devide(+a, +b)));
30
+ });
23
31
  program.parse();
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@zeng_x_pang/cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
+ "build": "tsc",
9
10
  "test": "echo \"Error: no test specified\" && exit 1"
10
11
  },
11
12
  "bin": {
@@ -18,8 +19,8 @@
18
19
  "author": "",
19
20
  "license": "ISC",
20
21
  "dependencies": {
21
- "@zeng_x_pang/core": "1.0.0",
22
+ "@zeng_x_pang/core": "1.1.0",
22
23
  "chalk": "^5.6.2",
23
24
  "commander": "^14.0.3"
24
25
  }
25
- }
26
+ }
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from "commander";
2
+ import { add, devide, minus } from "@zeng_x_pang/core";
3
3
  import chalk from "chalk";
4
- import { add, minus } from "@zeng_x_pang/core";
4
+ import { Command } from "commander";
5
5
 
6
6
  const program = new Command();
7
7
 
@@ -25,4 +25,13 @@ program
25
25
  console.log(chalk.cyan(minus(+a, +b)));
26
26
  });
27
27
 
28
+ program
29
+ .command("devide")
30
+ .description("除法")
31
+ .argument("a", "第一个数字")
32
+ .argument("b", "第二个数字")
33
+ .action((a: string, b: string) => {
34
+ console.log(chalk.cyan(devide(+a, +b)));
35
+ });
36
+
28
37
  program.parse();