exflower-license-server 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/index.js +9 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,6 +10,10 @@ ExFlower 在线授权验证服务。管理 License Key、企业授权、实例
10
10
  # 安装
11
11
  npm install -g exflower-license-server
12
12
 
13
+ # 查看版本
14
+ exflower-license-server --version
15
+ # 输出: 1.0.2
16
+
13
17
  # 运行
14
18
  exflower-license-server
15
19
 
package/index.js CHANGED
@@ -14,8 +14,17 @@
14
14
  const express = require('express');
15
15
  const cors = require('cors');
16
16
  const path = require('path');
17
+ const fs = require('fs');
17
18
  const { setupRoutes } = require('./routes');
18
19
 
20
+ const args = process.argv.slice(2);
21
+ if (args.includes('--version') || args.includes('-v')) {
22
+ const pkgPath = path.join(__dirname, 'package.json');
23
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
24
+ console.log(pkg.version);
25
+ process.exit(0);
26
+ }
27
+
19
28
  const app = express();
20
29
  const PORT = process.env.PORT || 4001;
21
30
  const ADMIN_TOKEN = process.env.ADMIN_TOKEN || 'exflower-admin-2026';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exflower-license-server",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "ExFlower License Server - 在线授权验证服务",
5
5
  "main": "index.js",
6
6
  "bin": {