@ac-kit/cmd-exiftool 0.0.0-stage → 0.1.1
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 +42 -0
- package/LICENSE +28 -0
- package/README.md +176 -2
- package/dist/_argfile.d.ts +41 -0
- package/dist/_argfile.d.ts.map +1 -0
- package/dist/_argfile.js +99 -0
- package/dist/_argfile.js.map +1 -0
- package/dist/_inspect-file.d.ts +32 -0
- package/dist/_inspect-file.d.ts.map +1 -0
- package/dist/_inspect-file.js +103 -0
- package/dist/_inspect-file.js.map +1 -0
- package/dist/_parse-json-output.d.ts +31 -0
- package/dist/_parse-json-output.d.ts.map +1 -0
- package/dist/_parse-json-output.js +132 -0
- package/dist/_parse-json-output.js.map +1 -0
- package/dist/_print-read-arguments.d.ts +42 -0
- package/dist/_print-read-arguments.d.ts.map +1 -0
- package/dist/_print-read-arguments.js +152 -0
- package/dist/_print-read-arguments.js.map +1 -0
- package/dist/_process-handle.d.ts +7 -0
- package/dist/_process-handle.d.ts.map +1 -0
- package/dist/_process-handle.js +2 -0
- package/dist/_process-handle.js.map +1 -0
- package/dist/_response-reader.d.ts +54 -0
- package/dist/_response-reader.d.ts.map +1 -0
- package/dist/_response-reader.js +129 -0
- package/dist/_response-reader.js.map +1 -0
- package/dist/_worker.d.ts +104 -0
- package/dist/_worker.d.ts.map +1 -0
- package/dist/_worker.js +327 -0
- package/dist/_worker.js.map +1 -0
- package/dist/date-time.d.ts +28 -0
- package/dist/date-time.d.ts.map +1 -0
- package/dist/date-time.js +74 -0
- package/dist/date-time.js.map +1 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +151 -0
- package/dist/errors.js.map +1 -0
- package/dist/exiftool-pool.d.ts +203 -0
- package/dist/exiftool-pool.d.ts.map +1 -0
- package/dist/exiftool-pool.js +455 -0
- package/dist/exiftool-pool.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/metadata.d.ts +46 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +8 -0
- package/dist/metadata.js.map +1 -0
- package/dist/read-options.d.ts +86 -0
- package/dist/read-options.d.ts.map +1 -0
- package/dist/read-options.js +2 -0
- package/dist/read-options.js.map +1 -0
- package/dist/version.d.ts +39 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +53 -0
- package/dist/version.js.map +1 -0
- package/package.json +61 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-options.js","sourceRoot":"","sources":["../src/read-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** An exiftool version number, such as `13.50`. */
|
|
2
|
+
export type ExiftoolVersion = {
|
|
3
|
+
readonly major: number;
|
|
4
|
+
/** The two digits after the point, as an integer: `50` for `13.50`. */
|
|
5
|
+
readonly minor: number;
|
|
6
|
+
/** The version as exiftool printed it, trimmed. */
|
|
7
|
+
readonly text: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The oldest exiftool the pool accepts, checked when a process starts.
|
|
11
|
+
*
|
|
12
|
+
* 12.38 fixed CVE-2022-23935 (code execution through a crafted file name);
|
|
13
|
+
* 12.40 is what Ubuntu 22.04 ships. Every protocol feature used here
|
|
14
|
+
* (`-stay_open`, `-echo4` with `${status}`, `#[CSTR]` argument lines, `-charset
|
|
15
|
+
* filename=`) is older.
|
|
16
|
+
*/
|
|
17
|
+
export declare const EXIFTOOL_MINIMUM_VERSION: ExiftoolVersion;
|
|
18
|
+
/**
|
|
19
|
+
* The oldest exiftool that reads with `scalars: "text"`: 13.00 is the first
|
|
20
|
+
* release whose `-api StructFormat=JSONQ` quotes every value, inside structures
|
|
21
|
+
* too, so the text is exactly what exiftool printed.
|
|
22
|
+
*/
|
|
23
|
+
export declare const EXIFTOOL_TEXT_SCALARS_VERSION: ExiftoolVersion;
|
|
24
|
+
/**
|
|
25
|
+
* Parses what `exiftool -ver` prints.
|
|
26
|
+
*
|
|
27
|
+
* @param text The output, surrounding whitespace allowed. A suffix after the
|
|
28
|
+
* number (a development build marker) is ignored.
|
|
29
|
+
* @returns The version, or `null` when the text does not start with
|
|
30
|
+
* `<digits>.<digits>`. O(length).
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseExiftoolVersion(text: string): ExiftoolVersion | null;
|
|
33
|
+
/**
|
|
34
|
+
* Orders two versions.
|
|
35
|
+
*
|
|
36
|
+
* @returns Negative when `left` is older, positive when newer, 0 when equal.
|
|
37
|
+
*/
|
|
38
|
+
export declare function compareExiftoolVersions(left: ExiftoolVersion, right: ExiftoolVersion): number;
|
|
39
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,eAIrC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,eAI1C,CAAC;AAIH;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAazE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,eAAe,GACpB,MAAM,CAER"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The oldest exiftool the pool accepts, checked when a process starts.
|
|
3
|
+
*
|
|
4
|
+
* 12.38 fixed CVE-2022-23935 (code execution through a crafted file name);
|
|
5
|
+
* 12.40 is what Ubuntu 22.04 ships. Every protocol feature used here
|
|
6
|
+
* (`-stay_open`, `-echo4` with `${status}`, `#[CSTR]` argument lines, `-charset
|
|
7
|
+
* filename=`) is older.
|
|
8
|
+
*/
|
|
9
|
+
export const EXIFTOOL_MINIMUM_VERSION = Object.freeze({
|
|
10
|
+
major: 12,
|
|
11
|
+
minor: 40,
|
|
12
|
+
text: "12.40",
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* The oldest exiftool that reads with `scalars: "text"`: 13.00 is the first
|
|
16
|
+
* release whose `-api StructFormat=JSONQ` quotes every value, inside structures
|
|
17
|
+
* too, so the text is exactly what exiftool printed.
|
|
18
|
+
*/
|
|
19
|
+
export const EXIFTOOL_TEXT_SCALARS_VERSION = Object.freeze({
|
|
20
|
+
major: 13,
|
|
21
|
+
minor: 0,
|
|
22
|
+
text: "13.00",
|
|
23
|
+
});
|
|
24
|
+
const VERSION_PATTERN_ = /^(\d{1,6})\.(\d{1,6})(?:\D.*)?$/s;
|
|
25
|
+
/**
|
|
26
|
+
* Parses what `exiftool -ver` prints.
|
|
27
|
+
*
|
|
28
|
+
* @param text The output, surrounding whitespace allowed. A suffix after the
|
|
29
|
+
* number (a development build marker) is ignored.
|
|
30
|
+
* @returns The version, or `null` when the text does not start with
|
|
31
|
+
* `<digits>.<digits>`. O(length).
|
|
32
|
+
*/
|
|
33
|
+
export function parseExiftoolVersion(text) {
|
|
34
|
+
const trimmed = text.trim();
|
|
35
|
+
const match = VERSION_PATTERN_.exec(trimmed);
|
|
36
|
+
if (match === null) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
major: Number(match[1]),
|
|
41
|
+
minor: Number(match[2]),
|
|
42
|
+
text: trimmed,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Orders two versions.
|
|
47
|
+
*
|
|
48
|
+
* @returns Negative when `left` is older, positive when newer, 0 when equal.
|
|
49
|
+
*/
|
|
50
|
+
export function compareExiftoolVersions(left, right) {
|
|
51
|
+
return left.major - right.major || left.minor - right.minor;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAoB,MAAM,CAAC,MAAM,CAAC;IACtE,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,OAAO;CACb,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAoB,MAAM,CAAC,MAAM,CAAC;IAC3E,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,OAAO;CACb,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE7C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO;QACN,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,OAAO;KACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACtC,IAAqB,EACrB,KAAsB;IAEtB,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/cmd-exiftool",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Typed exiftool reads through a pool of -stay_open processes: safe argument encoding, request matching, cancellation and restart.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"exif",
|
|
8
|
+
"exiftool",
|
|
9
|
+
"metadata",
|
|
10
|
+
"wrapper",
|
|
11
|
+
"xmp"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://anthochamp.pages.grenadine.io/node-essentials/api/cmd-exiftool/",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
16
|
+
},
|
|
17
|
+
"license": "BSD-3-Clause",
|
|
18
|
+
"author": "Anthony Champagne <dev@anthonychampagne.fr>",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://git.grenadine.io/anthochamp/node-essentials.git",
|
|
22
|
+
"directory": "packages/cmd-exiftool"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"compile": "tsc -p ./tsconfig.build.json -outDir dist",
|
|
36
|
+
"compile:check": "tsc -noEmit -p ./tsconfig.json",
|
|
37
|
+
"clean": "rimraf dist",
|
|
38
|
+
"build": "yarn clean && yarn compile",
|
|
39
|
+
"test": "yarn run -T vitest run",
|
|
40
|
+
"prepack": "yarn build"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@ac-kit/core": "^0.11.0",
|
|
44
|
+
"@ac-kit/data": "^0.3.3",
|
|
45
|
+
"@ac-kit/node": "^0.10.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@ac-kit/algo": "0.4.1",
|
|
49
|
+
"@ac-kit/app-system": "0.6.0",
|
|
50
|
+
"@ac-kit/math-random": "0.3.0",
|
|
51
|
+
"@ac-kit/tsconfig": "0.1.0",
|
|
52
|
+
"@ac-kit/typedoc-config": "0.1.0",
|
|
53
|
+
"@ac-kit/vitest-config": "0.1.1",
|
|
54
|
+
"@types/node": "26.6.6",
|
|
55
|
+
"@typescript/native": "typescript@7.0.2",
|
|
56
|
+
"rimraf": "6.1.4",
|
|
57
|
+
"tsx": "4.23.15",
|
|
58
|
+
"typedoc": "0.28.20",
|
|
59
|
+
"typescript": "@typescript/typescript6@6.0.2"
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=24"
|
|
63
|
+
}
|
|
6
64
|
}
|