+6
-3
@@ -5,2 +5,7 @@ #!/usr/bin/env node | ||
| import { cac } from "cac"; | ||
| //#region src/command.ts | ||
| function registerUploadCommand(cli, action) { | ||
| return cli.command("[...files]", "Upload image files to edge-onedrive image hosting").option("--host <host>", "edge-onedrive upload host, for example https://example.com").option("--key <key>", "edge-onedrive API key or access token").option("--keepName", "keep original file names").option("--prefix <prefix>", "public URL prefix for output links, defaults to --host").example("eod-cli --host example.com --key sk_xxx image.png").example("eod-cli --host https://example.com --key sk_xxx --prefix https://cdn.example.com --keepName a.png b.jpg").action(action); | ||
| } | ||
| //#endregion | ||
| //#region src/index.ts | ||
@@ -50,6 +55,4 @@ const cli = cac("eod-cli"); | ||
| } | ||
| cli.command("[files...]", "Upload image files to edge-onedrive image hosting").option("--host <host>", "edge-onedrive upload host, for example https://example.com").option("--key <key>", "edge-onedrive API key or access token").option("--keepName", "keep original file names").option("--prefix <prefix>", "public URL prefix for output links, defaults to --host").example("eod-cli --host example.com --key sk_xxx image.png").example("eod-cli --host https://example.com --key sk_xxx --prefix https://cdn.example.com --keepName a.png b.jpg").action(async (...args) => { | ||
| registerUploadCommand(cli, async (files, options) => { | ||
| try { | ||
| const options = args.at(-1); | ||
| const files = args.slice(0, -1); | ||
| if (!options.key) throw new Error("--key is required"); | ||
@@ -56,0 +59,0 @@ if (!files.length) throw new Error("At least one file is required"); |
+5
-3
| { | ||
| "name": "eod-cli", | ||
| "version": "0.1.0", | ||
| "version": "0.2.0", | ||
| "private": false, | ||
@@ -23,10 +23,12 @@ "type": "module", | ||
| "dependencies": { | ||
| "cac": "^6.7.14" | ||
| "cac": "^7.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "bumpp": "^11.1.0", | ||
| "tsdown": "^0.22.3" | ||
| "tsdown": "^0.22.14", | ||
| "vitest": "^4.1.10" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsdown", | ||
| "test": "vitest run", | ||
| "tc": "tsc --noEmit --skipLibCheck", | ||
@@ -33,0 +35,0 @@ "prepublish": "pnpm build", |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
4051
3.11%79
2.6%2
-33.33%3
50%+ Added
- Removed
Updated