@dudko.dev/vectorize-cli 0.4.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/LICENSE +75 -0
- package/LICENSE-FREE-TRIAL +55 -0
- package/README.md +52 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +188 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Required Notice: Copyright 2026 Siarhei Dudko (https://vectorize.dudko.dev)
|
|
2
|
+
|
|
3
|
+
# PolyForm Noncommercial License 1.0.0
|
|
4
|
+
|
|
5
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
+
|
|
15
|
+
## Distribution License
|
|
16
|
+
|
|
17
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
+
|
|
19
|
+
## Notices
|
|
20
|
+
|
|
21
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
+
|
|
23
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
+
|
|
25
|
+
## Changes and New Works License
|
|
26
|
+
|
|
27
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
+
|
|
29
|
+
## Patent License
|
|
30
|
+
|
|
31
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
+
|
|
33
|
+
## Noncommercial Purposes
|
|
34
|
+
|
|
35
|
+
Any noncommercial purpose is a permitted purpose.
|
|
36
|
+
|
|
37
|
+
## Personal Uses
|
|
38
|
+
|
|
39
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
+
|
|
41
|
+
## Noncommercial Organizations
|
|
42
|
+
|
|
43
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
+
|
|
45
|
+
## Fair Use
|
|
46
|
+
|
|
47
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
+
|
|
49
|
+
## No Other Rights
|
|
50
|
+
|
|
51
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
+
|
|
53
|
+
## Patent Defense
|
|
54
|
+
|
|
55
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
+
|
|
57
|
+
## Violations
|
|
58
|
+
|
|
59
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
+
|
|
61
|
+
## No Liability
|
|
62
|
+
|
|
63
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
64
|
+
|
|
65
|
+
## Definitions
|
|
66
|
+
|
|
67
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
+
|
|
69
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
+
|
|
71
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
+
|
|
73
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
+
|
|
75
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# PolyForm Free Trial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/free-trial/1.0.0>
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license), and you may not distribute copies of the software.
|
|
12
|
+
|
|
13
|
+
## Changes and New Works License
|
|
14
|
+
|
|
15
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
16
|
+
|
|
17
|
+
## Patent License
|
|
18
|
+
|
|
19
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
20
|
+
|
|
21
|
+
## Fair Use
|
|
22
|
+
|
|
23
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
24
|
+
|
|
25
|
+
## Free Trial
|
|
26
|
+
|
|
27
|
+
Use to evaluate whether the software suits a particular application for less than 32 consecutive calendar days, on behalf of you or your company, is use for a permitted purpose.
|
|
28
|
+
|
|
29
|
+
## No Other Rights
|
|
30
|
+
|
|
31
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
32
|
+
|
|
33
|
+
## Patent Defense
|
|
34
|
+
|
|
35
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
36
|
+
|
|
37
|
+
## Violations
|
|
38
|
+
|
|
39
|
+
If you violate any of these terms, or do anything with the software not covered by your licenses, all your licenses end immediately.
|
|
40
|
+
|
|
41
|
+
## No Liability
|
|
42
|
+
|
|
43
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
44
|
+
|
|
45
|
+
## Definitions
|
|
46
|
+
|
|
47
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
48
|
+
|
|
49
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
50
|
+
|
|
51
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
52
|
+
|
|
53
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
54
|
+
|
|
55
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @dudko.dev/vectorize-cli
|
|
2
|
+
|
|
3
|
+
Command-line raster → vector conversion. Wraps
|
|
4
|
+
[`@dudko.dev/vectorize-core`](https://www.npmjs.com/package/@dudko.dev/vectorize-core):
|
|
5
|
+
the Rust tracing core compiled to WebAssembly, with SVG, PDF, EPS and DXF output.
|
|
6
|
+
|
|
7
|
+
## Licence — read this before you install it
|
|
8
|
+
|
|
9
|
+
**Free, with no time limit, for noncommercial use** under the
|
|
10
|
+
[PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0)
|
|
11
|
+
(`LICENSE` in this package): personal study, research, experiment, hobby
|
|
12
|
+
projects and amateur pursuits, plus use by charities, educational institutions,
|
|
13
|
+
public research bodies, public safety and health organizations, environmental
|
|
14
|
+
organizations and government institutions.
|
|
15
|
+
|
|
16
|
+
**32 days to evaluate it at work**, under
|
|
17
|
+
[PolyForm Free Trial 1.0.0](https://polyformproject.org/licenses/free-trial/1.0.0)
|
|
18
|
+
(`LICENSE-FREE-TRIAL` in this package),
|
|
19
|
+
granted alongside the above — for trying it, not for redistributing it.
|
|
20
|
+
|
|
21
|
+
**Anything else commercial needs a written licence**, including running it inside
|
|
22
|
+
a product or service offered to third parties for a fee, and a company's own
|
|
23
|
+
internal business use. Ask: sergey@dudko.dev
|
|
24
|
+
|
|
25
|
+
A hosted API is planned at `vectorize-api.dudko.dev`, where a paid account will
|
|
26
|
+
carry commercial permission for use of that service. Accounts are not open yet.
|
|
27
|
+
|
|
28
|
+
The WebAssembly modules come from `@dudko.dev/vectorize-core`, whose
|
|
29
|
+
`THIRD-PARTY-NOTICES.md` carries the notices for the Rust crates linked into
|
|
30
|
+
them.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm i -g @dudko.dev/vectorize-cli
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Use
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
vectorize logo.png -o logo.svg
|
|
42
|
+
vectorize photo.jpg --preset photo --colors 16 --format pdf --dpi 300 -o photo.pdf
|
|
43
|
+
vectorize scan.png --preset bw --adaptive --centerline -o scan.dxf
|
|
44
|
+
vectorize --help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Presets (`-p`, `--preset`) are `photo`, `poster` (flat colour graphics and logos)
|
|
48
|
+
and `bw` (line art and scans). `-f`, `--format` takes `svg`, `pdf`, `eps` or
|
|
49
|
+
`dxf`, and `--json` prints the run's statistics to stdout alongside whichever of
|
|
50
|
+
those you wrote. The rest of the tracer's options — `--colors`, `--denoise`,
|
|
51
|
+
`--corner`, `--curve`, `--gap-fill`, `--gradient-tolerance` and the others — are
|
|
52
|
+
listed by `--help`.
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { basename, extname } from 'node:path';
|
|
4
|
+
import { parseArgs } from 'node:util';
|
|
5
|
+
import { toDxf, toEps, toPdf, traceEncoded, withSize } from '@dudko.dev/vectorize-core';
|
|
6
|
+
const FORMATS = ['svg', 'eps', 'pdf', 'dxf'];
|
|
7
|
+
const HELP = `vectorize — convert raster images (PNG/JPEG/GIF/BMP/WebP) to vector graphics
|
|
8
|
+
|
|
9
|
+
Usage: vectorize <input> [options]
|
|
10
|
+
|
|
11
|
+
Output:
|
|
12
|
+
-o, --output <file> Output path (default: <input>.<format>)
|
|
13
|
+
-f, --format <fmt> svg | eps | pdf | dxf (default: svg)
|
|
14
|
+
--dpi <n> Pixels per inch for physical sizes (default: 96)
|
|
15
|
+
--unit <u> SVG size unit: px | mm | cm | in | pt (default: px)
|
|
16
|
+
--width <n> SVG output width in --unit (height keeps the aspect ratio)
|
|
17
|
+
--json Print stats as JSON to stdout
|
|
18
|
+
|
|
19
|
+
Tracing:
|
|
20
|
+
-p, --preset <name> bw | poster | photo (default: poster)
|
|
21
|
+
--mode <mode> color | binary
|
|
22
|
+
--layering <mode> stacked | cutout | shared
|
|
23
|
+
--curve <mode> pixel | polygon | spline
|
|
24
|
+
--colors <n> Quantise to at most N colours (0 = auto clustering)
|
|
25
|
+
--palette <list> Fixed palette, comma-separated #rrggbb (overrides --colors)
|
|
26
|
+
--superpixels <px> SLIC superpixel size before quantising (photos), 0 = off
|
|
27
|
+
--smooth <0-10> Edge-preserving smoothing before tracing
|
|
28
|
+
--denoise <passes> Median-filter passes before tracing, 0–5
|
|
29
|
+
--clean-edges <n> Label-map cleanup passes (anti-aliasing halos), 0–4
|
|
30
|
+
--gap-fill <px> Stroke shapes in their own colour to hide seams
|
|
31
|
+
--transparent Drop the background colour (transparent output)
|
|
32
|
+
--no-gradients Keep flat bands instead of reconstructing linear gradients
|
|
33
|
+
--no-salient Let k-means absorb small contrasting regions
|
|
34
|
+
--text <mode> off | trace | raster: detect text blocks and trace their glyphs (4× coverage map) or embed as PNG
|
|
35
|
+
--gradient-tolerance <n> Max RMS residual for bands to become one gradient (default 6)
|
|
36
|
+
--upscale <factor> Upscale 1–4× before tracing (smoother curves)
|
|
37
|
+
--speckle <px> Drop patches smaller than N source pixels
|
|
38
|
+
--color-precision <b> Colour precision bits 1–8 (auto clustering)
|
|
39
|
+
--layer-diff <n> Layer difference 0–255
|
|
40
|
+
--corner <deg> Corner threshold 0–180
|
|
41
|
+
--length <px> Segment length 3.5–10
|
|
42
|
+
--splice <deg> Splice threshold 0–180
|
|
43
|
+
--precision <n> Decimal places in coordinates
|
|
44
|
+
--threshold <0-255> Luminance cut-off for binary mode
|
|
45
|
+
--adaptive Sauvola local threshold (uneven lighting)
|
|
46
|
+
--centerline Binary mode: stroked centre lines instead of outlines
|
|
47
|
+
--stroke-width <px> Fixed centre-line width (default: measured)
|
|
48
|
+
--stroke-color <hex> Centre-line colour (default #000000)
|
|
49
|
+
-h, --help Show this help
|
|
50
|
+
`;
|
|
51
|
+
function num(v) {
|
|
52
|
+
if (v === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
const n = Number(v);
|
|
55
|
+
if (!Number.isFinite(n))
|
|
56
|
+
throw new Error(`expected a number, got "${v}"`);
|
|
57
|
+
return n;
|
|
58
|
+
}
|
|
59
|
+
function oneOf(v, allowed, flag) {
|
|
60
|
+
if (v === undefined)
|
|
61
|
+
return undefined;
|
|
62
|
+
if (!allowed.includes(v))
|
|
63
|
+
throw new Error(`--${flag} must be one of ${allowed.join(', ')}`);
|
|
64
|
+
return v;
|
|
65
|
+
}
|
|
66
|
+
export async function main(argv) {
|
|
67
|
+
const { values, positionals } = parseArgs({
|
|
68
|
+
args: argv,
|
|
69
|
+
allowPositionals: true,
|
|
70
|
+
options: {
|
|
71
|
+
output: { type: 'string', short: 'o' },
|
|
72
|
+
format: { type: 'string', short: 'f' },
|
|
73
|
+
dpi: { type: 'string' },
|
|
74
|
+
unit: { type: 'string' },
|
|
75
|
+
width: { type: 'string' },
|
|
76
|
+
preset: { type: 'string', short: 'p' },
|
|
77
|
+
mode: { type: 'string' },
|
|
78
|
+
layering: { type: 'string' },
|
|
79
|
+
curve: { type: 'string' },
|
|
80
|
+
colors: { type: 'string' },
|
|
81
|
+
palette: { type: 'string' },
|
|
82
|
+
smooth: { type: 'string' },
|
|
83
|
+
'clean-edges': { type: 'string' },
|
|
84
|
+
'gap-fill': { type: 'string' },
|
|
85
|
+
transparent: { type: 'boolean', default: false },
|
|
86
|
+
'no-gradients': { type: 'boolean', default: false },
|
|
87
|
+
'no-salient': { type: 'boolean', default: false },
|
|
88
|
+
text: { type: 'string' },
|
|
89
|
+
'gradient-tolerance': { type: 'string' },
|
|
90
|
+
superpixels: { type: 'string' },
|
|
91
|
+
adaptive: { type: 'boolean', default: false },
|
|
92
|
+
centerline: { type: 'boolean', default: false },
|
|
93
|
+
'stroke-width': { type: 'string' },
|
|
94
|
+
'stroke-color': { type: 'string' },
|
|
95
|
+
denoise: { type: 'string' },
|
|
96
|
+
upscale: { type: 'string' },
|
|
97
|
+
speckle: { type: 'string' },
|
|
98
|
+
'color-precision': { type: 'string' },
|
|
99
|
+
'layer-diff': { type: 'string' },
|
|
100
|
+
corner: { type: 'string' },
|
|
101
|
+
length: { type: 'string' },
|
|
102
|
+
splice: { type: 'string' },
|
|
103
|
+
precision: { type: 'string' },
|
|
104
|
+
threshold: { type: 'string' },
|
|
105
|
+
json: { type: 'boolean', default: false },
|
|
106
|
+
help: { type: 'boolean', short: 'h', default: false },
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
if (values.help || positionals.length === 0) {
|
|
110
|
+
process.stdout.write(HELP);
|
|
111
|
+
return values.help ? 0 : 1;
|
|
112
|
+
}
|
|
113
|
+
const input = positionals[0];
|
|
114
|
+
const format = oneOf(values.format, FORMATS, 'format') ?? 'svg';
|
|
115
|
+
const output = values.output ?? input.slice(0, input.length - extname(input).length) + '.' + format;
|
|
116
|
+
const options = {
|
|
117
|
+
preset: oneOf(values.preset, ['bw', 'poster', 'photo'], 'preset'),
|
|
118
|
+
mode: oneOf(values.mode, ['color', 'binary'], 'mode'),
|
|
119
|
+
layering: oneOf(values.layering, ['stacked', 'cutout', 'shared'], 'layering'),
|
|
120
|
+
curveMode: oneOf(values.curve, ['pixel', 'polygon', 'spline'], 'curve'),
|
|
121
|
+
maxColors: num(values.colors),
|
|
122
|
+
palette: values.palette ? values.palette.split(',').map((c) => c.trim()).filter(Boolean) : undefined,
|
|
123
|
+
smooth: num(values.smooth),
|
|
124
|
+
cleanEdges: num(values['clean-edges']),
|
|
125
|
+
gapFill: num(values['gap-fill']),
|
|
126
|
+
transparentBackground: values.transparent ? true : undefined,
|
|
127
|
+
superpixels: num(values.superpixels),
|
|
128
|
+
gradients: values['no-gradients'] ? false : undefined,
|
|
129
|
+
salientColors: values['no-salient'] ? false : undefined,
|
|
130
|
+
text: oneOf(values.text, ['off', 'trace', 'raster'], 'text'),
|
|
131
|
+
gradientTolerance: num(values['gradient-tolerance']),
|
|
132
|
+
adaptiveThreshold: values.adaptive ? true : undefined,
|
|
133
|
+
strokeMode: values.centerline ? 'centerline' : undefined,
|
|
134
|
+
strokeWidth: num(values['stroke-width']),
|
|
135
|
+
strokeColor: values['stroke-color'],
|
|
136
|
+
denoise: num(values.denoise),
|
|
137
|
+
upscale: num(values.upscale),
|
|
138
|
+
filterSpeckle: num(values.speckle),
|
|
139
|
+
colorPrecision: num(values['color-precision']),
|
|
140
|
+
layerDifference: num(values['layer-diff']),
|
|
141
|
+
cornerThreshold: num(values.corner),
|
|
142
|
+
lengthThreshold: num(values.length),
|
|
143
|
+
spliceThreshold: num(values.splice),
|
|
144
|
+
pathPrecision: num(values.precision),
|
|
145
|
+
threshold: num(values.threshold),
|
|
146
|
+
};
|
|
147
|
+
const bytes = await readFile(input);
|
|
148
|
+
const started = performance.now();
|
|
149
|
+
const result = await traceEncoded(bytes, options);
|
|
150
|
+
const ms = Math.round(performance.now() - started);
|
|
151
|
+
const dpi = num(values.dpi) ?? 96;
|
|
152
|
+
const unit = oneOf(values.unit, ['px', 'mm', 'cm', 'in', 'pt'], 'unit');
|
|
153
|
+
const width = num(values.width);
|
|
154
|
+
const body = format === 'svg'
|
|
155
|
+
? withSize(result.svg, result.width, result.height, { dpi, unit, width })
|
|
156
|
+
: format === 'eps'
|
|
157
|
+
? toEps(result, { dpi })
|
|
158
|
+
: format === 'pdf'
|
|
159
|
+
? toPdf(result, { dpi })
|
|
160
|
+
: toDxf(result, { dpi });
|
|
161
|
+
await writeFile(output, body);
|
|
162
|
+
const stats = {
|
|
163
|
+
input: basename(input),
|
|
164
|
+
output,
|
|
165
|
+
format,
|
|
166
|
+
width: result.width,
|
|
167
|
+
height: result.height,
|
|
168
|
+
paths: result.pathCount,
|
|
169
|
+
colors: result.palette.length,
|
|
170
|
+
bytes: typeof body === 'string' ? Buffer.byteLength(body) : body.byteLength,
|
|
171
|
+
ms,
|
|
172
|
+
};
|
|
173
|
+
if (values.json) {
|
|
174
|
+
process.stdout.write(JSON.stringify(stats) + '\n');
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
process.stderr.write(`${stats.input} → ${output}: ${stats.paths} paths, ${stats.colors} colours, ${(stats.bytes / 1024).toFixed(1)} KiB, ${ms} ms\n`);
|
|
178
|
+
}
|
|
179
|
+
return 0;
|
|
180
|
+
}
|
|
181
|
+
// Run when executed directly (not when imported by tests).
|
|
182
|
+
if (process.argv[1] && import.meta.url === new URL(`file://${process.argv[1]}`).href) {
|
|
183
|
+
main(process.argv.slice(2)).then((code) => process.exit(code), (err) => {
|
|
184
|
+
process.stderr.write(`error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
185
|
+
process.exit(1);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=cli.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dudko.dev/vectorize-cli",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Command-line raster → SVG converter",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
7
|
+
"bin": {
|
|
8
|
+
"vectorize": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"!dist/**/*.map",
|
|
13
|
+
"LICENSE-FREE-TRIAL"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc -p tsconfig.json",
|
|
17
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
18
|
+
"test": "vitest run"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@dudko.dev/vectorize-core": "workspace:*"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^22.18.0",
|
|
25
|
+
"typescript": "^5.9.2",
|
|
26
|
+
"vitest": "^4.1.11"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/dudko-dev/vectorize.git",
|
|
34
|
+
"directory": "packages/cli"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"svg",
|
|
38
|
+
"vectorize",
|
|
39
|
+
"cli"
|
|
40
|
+
],
|
|
41
|
+
"homepage": "https://vectorize.dudko.dev",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"email": "sergey@dudko.dev"
|
|
44
|
+
},
|
|
45
|
+
"author": "Siarhei Dudko <sergey@dudko.dev>"
|
|
46
|
+
}
|