@uxf/resizer 11.125.0 → 11.126.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/README.md +14 -14
- package/bin/uxf-resizer.js +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,10 +72,10 @@ NEXT_PUBLIC_API_URL=https://uxf.cz # ProxyGET source (fetches <API
|
|
|
72
72
|
|
|
73
73
|
Exported from the package root (`@uxf/resizer`):
|
|
74
74
|
|
|
75
|
-
| Export
|
|
76
|
-
|
|
77
|
-
| `ProxyGET`
|
|
78
|
-
| `StaticGET` | `(request: Request) => Promise<Response>` | Next.js route handler. Matches `/generated/static/..._:quality/:version/:filename.:extension.:toFormat`. Reads local `public/:filename.:extension`; for `_next/static/media/*` imports it fetches from `${NEXT_PUBLIC_FRONTEND_URL}`.
|
|
75
|
+
| Export | Signature | Description |
|
|
76
|
+
| ----------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| `ProxyGET` | `(request: Request) => Promise<Response>` | Next.js route handler. Matches `/generated/:namespace/:p1/:p2/:filename_..._:extension.:toFormat`, fetches the source from `${NEXT_PUBLIC_API_URL}/upload/:namespace/:p1/:p2/:filename.:extension`, resizes, caches under the process CWD, and returns the image. |
|
|
78
|
+
| `StaticGET` | `(request: Request) => Promise<Response>` | Next.js route handler. Matches `/generated/static/..._:quality/:version/:filename.:extension.:toFormat`. Reads local `public/:filename.:extension`; for `_next/static/media/*` imports it fetches from `${NEXT_PUBLIC_FRONTEND_URL}`. |
|
|
79
79
|
|
|
80
80
|
Command-line server:
|
|
81
81
|
|
|
@@ -89,16 +89,16 @@ Starts an Express server on port `3000` that applies the routes from the configu
|
|
|
89
89
|
|
|
90
90
|
The URL segments understood by every route. They are produced by `resizerImageUrl` (`@uxf/core`) and mapped onto [`sharp`](https://sharp.pixelplumbing.com/) options.
|
|
91
91
|
|
|
92
|
-
| Parameter | Values
|
|
93
|
-
|
|
94
|
-
| width | `number` or `x` (auto)
|
|
95
|
-
| height | `number` or `x` (auto)
|
|
96
|
-
| fit | fit code (see below)
|
|
97
|
-
| position | position code (see below)
|
|
98
|
-
| background | hex (e.g. `FFFFFF`) or `t` (transparent)
|
|
99
|
-
| trim | `number` (threshold) or `nt` (no trim)
|
|
100
|
-
| quality | `number` (1–100) or `x` (auto)
|
|
101
|
-
| toFormat | `webp`, `png`, `avif`, `jpg`, `svg`
|
|
92
|
+
| Parameter | Values | Default (falls back to sharp) |
|
|
93
|
+
| ---------- | ---------------------------------------- | ------------------------------------ |
|
|
94
|
+
| width | `number` or `x` (auto) | `undefined` (auto) |
|
|
95
|
+
| height | `number` or `x` (auto) | `undefined` (auto) |
|
|
96
|
+
| fit | fit code (see below) | `cover` |
|
|
97
|
+
| position | position code (see below) | sharp default (`centre`) |
|
|
98
|
+
| background | hex (e.g. `FFFFFF`) or `t` (transparent) | `#<hex>` |
|
|
99
|
+
| trim | `number` (threshold) or `nt` (no trim) | no trim |
|
|
100
|
+
| quality | `number` (1–100) or `x` (auto) | sharp default (avif: 50, others: 80) |
|
|
101
|
+
| toFormat | `webp`, `png`, `avif`, `jpg`, `svg` | `jpg` |
|
|
102
102
|
|
|
103
103
|
`svg` is a passthrough — the source file is copied unchanged, without resizing.
|
|
104
104
|
|
package/bin/uxf-resizer.js
CHANGED
|
File without changes
|