@@ -36,26 +36,44 @@ OPTIONS:
36
36
-h, --help Prints this help and exit
37
37
-V, --version Prints version information
38
38
-y, --yarn-lock-file Path to a yarn.lock file to parse
39
+ --filter [descriptors] Keep only matching versions
40
+ (e.g. --filter '>=1.3.0, <2.0.0')
39
41
40
42
ARGS:
41
43
package[@range] Package to search for, with or without range.
42
44
The range must match one in yarn.lock
43
45
```
44
46
45
- Example output (searching for ` lodash ` )
46
-
47
+ Example output (searching for ` fs-minipass ` )
48
+
49
+ ``` bash
50
+
51
+
52
+ │ └─
[email protected] (via latest)
53
+ │ ├─
[email protected] (via ^13.0.0)
54
+ │ │ └─
[email protected] (via ^18.0.0)
55
+ │ │ ├─
[email protected] (via ^3.0.0)
56
+ │ │ └─
[email protected] (via ^6.1.11)
57
+ │ │ └─
[email protected] (via ^2.0.0)
58
+ │ └─
[email protected] (via ^6.1.2)
59
+ │ └─
[email protected] (via ^2.0.0)
60
+ └─
[email protected] (via ^4.13.0)
61
+
62
+
47
63
```
48
- ├─ standard@^11.0.0
49
- │ └─ eslint@~4.18.0
50
- │ ├─ inquirer@^3.0.6
51
- │ │ └─ lodash@^4.3.0
52
- │ ├─ lodash@^4.17.4
53
-
54
- │ └─ lodash@^4.17.4
55
- │
56
-
57
- └─ async@^2.1.2
58
- └─ lodash@^4.14.0
64
+
65
+ Similar search, but filtered for ` fs-minipass --filter '>=3.0, <4.0.0' `
66
+
67
+ ``` bash
68
+
69
+
70
+ │ └─
[email protected] (via latest)
71
+ │ └─
[email protected] (via ^13.0.0)
72
+ │ └─
[email protected] (via ^18.0.0)
73
+ │ └─
[email protected] (via ^3.0.0)
74
+ └─
[email protected] (via ^4.13.0)
75
+
76
+
59
77
```
60
78
61
79
Defaults:
@@ -65,35 +83,35 @@ Defaults:
65
83
66
84
## Benchmarks
67
85
68
- Benchmarks run on Thinkpad T460s
69
- - node 17.9.0
70
- - yarn 1.22.18 / yarn 3.2 .0
86
+ Benchmarks run on Framework Laptop 14 AMD Ryzen 7 7840U
87
+ - node 21.7.1
88
+ - yarn 1.22.22 / yarn 4.1 .0
71
89
- using [ renovate 35.45.5 yarn.lock file] ( https://github.com/renovatebot/renovate/blob/32.45.5/yarn.lock ) (v1 first, then updating it)
72
90
73
91
(had to use -y because hyperfine would trigger stdin input)
74
92
75
- ```
76
- $ hyperfine ' yarn-why -y yarn.lock lodash'
77
- Benchmark # 1: yarn-why -y yarn.lock lodash
78
- Time (mean ± σ): 9.4 ms ± 1 .6 ms [User: 8.3 ms, System: 1.1 ms]
79
- Range (min … max): 7.8 ms … 22.7 ms 191 runs
80
-
81
- $ hyperfine 'yarn why lodash'
82
- Benchmark # 1: yarn why lodash
83
- Time (mean ± σ): 1.012 s ± 0.012 s [User: 1.686 s , System: 0.101 s ]
84
- Range (min … max): 0.994 s … 1.026 s 10 runs
85
-
86
- # again, after updating yarn.lock using `yarn 3.2 .0`
87
-
88
- $ hyperfine ' yarn why lodash'
89
- Benchmark # 1: yarn why lodash
90
- ⠏ Current estimate: 45.455 s █████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ETA 00:05:17
91
- ^C # was taking too long, I stopped it
92
-
93
- hyperfine 'yarn- why -y yarn. lock lodash'
94
- Benchmark # 1: yarn-why -y yarn.lock lodash
95
- Time (mean ± σ): 11.8 ms ± 0.8 ms [User: 10.6 ms, System: 1.3 ms]
96
- Range (min … max): 9.8 ms … 14.5 ms 179 runs
93
+ ``` bash
94
+ $ hyperfine -w 3 ' ./target/release/ yarn-why lodash ' # yarn.lock v1
95
+ Benchmark 1: ./target/release/ yarn-why lodash
96
+ Time (mean ± σ): 4.9 ms ± 0 .6 ms [User: 3.8 ms, System: 1.1 ms]
97
+ Range (min … max): 2.3 ms … 7.8 ms 398 runs
98
+
99
+ $ hyperfine -w 3 ' yarn why lodash' # yarn v1.22.22 / yarn.lock v1
100
+ Benchmark 1: yarn why lodash
101
+ Time (mean ± σ): 416.0 ms ± 76.7 ms [User: 691.7 ms , System: 75.0 ms ]
102
+ Range (min … max): 367.9 ms … 608.7 ms 10 runs
103
+
104
+ # again, after updating the same yarn.lock to v8 using `yarn 4.1 .0`
105
+
106
+ $ hyperfine -w 3 ' ./target/release/ yarn- why lodash' # yarn.lock v8
107
+ Benchmark 1: ./target/release/ yarn- why lodash
108
+ Time (mean ± σ): 6.0 ms ± 0.6 ms [User: 4.6 ms, System: 1.4 ms]
109
+ Range (min … max): 3.6 ms … 8.5 ms 340 runs
110
+
111
+ $ hyperfine ' yarn why lodash ' # yarn v4.1.0 / yarn. lock v8
112
+ Benchmark 1: yarn why lodash
113
+ Time (mean ± σ): 295.0 ms ± 57.7 ms [User: 316.1 ms, System: 58.1 ms]
114
+ Range (min … max): 229.9 ms … 361.0 ms 10 runs
97
115
```
98
116
99
117
## LICENSE
0 commit comments