better-asset 0.1.0 → 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/README.md +7 -7
- package/bin/better-asset.js +24 -14
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -23,20 +23,20 @@ npx better-asset
|
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
# Create a starter config
|
|
26
|
-
|
|
26
|
+
asset init
|
|
27
27
|
|
|
28
28
|
# Edit assets.config.json, then generate
|
|
29
|
-
|
|
29
|
+
asset
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## CLI
|
|
33
33
|
|
|
34
34
|
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
asset Generate assets from config
|
|
36
|
+
asset init Create a starter config file
|
|
37
|
+
asset --config <path> Use a custom config file
|
|
38
|
+
asset --help Show help
|
|
39
|
+
asset --version Show version
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
## Supported Formats
|
package/bin/better-asset.js
CHANGED
|
@@ -6,26 +6,36 @@ import { generate } from "../src/generate.js";
|
|
|
6
6
|
import { defaultConfig } from "../src/config.js";
|
|
7
7
|
import * as log from "../src/log.js";
|
|
8
8
|
|
|
9
|
+
const B = "\x1b[1m";
|
|
10
|
+
const D = "\x1b[2m";
|
|
11
|
+
const R = "\x1b[0m";
|
|
12
|
+
const M = "\x1b[35m";
|
|
13
|
+
const C = "\x1b[36m";
|
|
14
|
+
const G = "\x1b[32m";
|
|
15
|
+
const Y = "\x1b[33m";
|
|
16
|
+
|
|
9
17
|
const HELP = `
|
|
10
|
-
|
|
18
|
+
${B}${M}better-asset${R} ${D}— config-driven image asset generator${R}
|
|
19
|
+
|
|
20
|
+
${B}USAGE${R}
|
|
21
|
+
|
|
22
|
+
${C}$${R} asset ${D}..................${R} generate assets from config
|
|
23
|
+
${C}$${R} asset init ${D}.............${R} create a starter config
|
|
24
|
+
${C}$${R} asset --config ${Y}<path>${R} ${D}..${R} use a custom config file
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
${B}OPTIONS${R}
|
|
13
27
|
|
|
14
|
-
$
|
|
15
|
-
$
|
|
16
|
-
$
|
|
17
|
-
$ better-asset --help Show this help
|
|
18
|
-
$ better-asset --version Show version
|
|
28
|
+
${G}--config${R} ${Y}<path>${R} Path to a custom config file
|
|
29
|
+
${G}--help${R}, ${G}-h${R} Show this help
|
|
30
|
+
${G}--version${R}, ${G}-v${R} Show version
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
${B}EXAMPLES${R}
|
|
21
33
|
|
|
22
|
-
$
|
|
23
|
-
$
|
|
24
|
-
$
|
|
34
|
+
${C}$${R} asset
|
|
35
|
+
${C}$${R} asset --config my-config.json
|
|
36
|
+
${C}$${R} asset init
|
|
25
37
|
|
|
26
|
-
|
|
27
|
-
For configuration and usage details, see the documentation:
|
|
28
|
-
https://npmjs.com/package/better-asset
|
|
38
|
+
${D}docs${R} ${D}https://npmjs.com/package/better-asset${R}
|
|
29
39
|
`;
|
|
30
40
|
|
|
31
41
|
async function getVersion() {
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-asset",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Config-driven image asset generator. Resize, convert, and generate favicons from a single JSON config.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
+
"asset": "bin/better-asset.js",
|
|
7
8
|
"better-asset": "bin/better-asset.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|