Skip to content

Commit 0810b68

Browse files
authored
docs: add find-up and clones (#223)
Piles of libraries that are basically curried functions of the exact same underlying logic. Easily replaced these days.
1 parent 71ec7e5 commit 0810b68

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

docs/modules/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ ESLint plugin.
3535
- [`ezspawn`](./process-exec.md)
3636
- [`faker`](./faker.md)
3737
- [`fast-glob`](./glob.md)
38+
- [`find-up` and related](./find-up.md)
3839
- [`fs-extra`](./fs-extra.md)
3940
- [`glob`](./glob.md)
4041
- [`globby`](./glob.md)

docs/modules/find-up.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# find-up, read-package-up, read-package, etc.
2+
3+
Many of these upwards traversal libraries are overly granular and non-generic.
4+
5+
We can replace most of them with one upwards traversal library and, sometimes, one file reading library.
6+
7+
# Alternatives
8+
9+
## empathic
10+
11+
`empathic` can be used to find _any_ file or directory upwards in the file system. It is very fast and very small.
12+
13+
[Project Page](https://github.com/lukeed/empathic)
14+
15+
[npm](https://www.npmjs.com/package/empathic)
16+
17+
## pkg-types
18+
19+
If you need to _read_ a `package.json` into a strong type, you can combine an upwards traversal library with `pkg-types`.
20+
21+
This library contains functions for reading `package.json` files and returning them as a strong type.
22+
23+
[Project Page](https://github.com/unjs/pkg-types/)
24+
25+
[npm](https://www.npmjs.com/package/pkg-types)

manifests/preferred.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,30 @@
156156
"docPath": "glob",
157157
"category": "preferred"
158158
},
159+
{
160+
"type": "documented",
161+
"moduleName": "find-cache-dir",
162+
"docPath": "find-up",
163+
"category": "preferred"
164+
},
165+
{
166+
"type": "documented",
167+
"moduleName": "find-cache-directory",
168+
"docPath": "find-up",
169+
"category": "preferred"
170+
},
171+
{
172+
"type": "documented",
173+
"moduleName": "find-file-up",
174+
"docPath": "find-up",
175+
"category": "preferred"
176+
},
177+
{
178+
"type": "documented",
179+
"moduleName": "find-up",
180+
"docPath": "find-up",
181+
"category": "preferred"
182+
},
159183
{
160184
"type": "documented",
161185
"moduleName": "fs-extra",
@@ -2196,12 +2220,24 @@
21962220
"docPath": "ora",
21972221
"category": "preferred"
21982222
},
2223+
{
2224+
"type": "documented",
2225+
"moduleName": "package-up",
2226+
"docPath": "find-up",
2227+
"category": "preferred"
2228+
},
21992229
{
22002230
"type": "documented",
22012231
"moduleName": "path-exists",
22022232
"docPath": "path-exists",
22032233
"category": "preferred"
22042234
},
2235+
{
2236+
"type": "documented",
2237+
"moduleName": "pkg-up",
2238+
"docPath": "find-up",
2239+
"category": "preferred"
2240+
},
22052241
{
22062242
"type": "documented",
22072243
"moduleName": "q",
@@ -2214,6 +2250,24 @@
22142250
"docPath": "qs",
22152251
"category": "preferred"
22162252
},
2253+
{
2254+
"type": "documented",
2255+
"moduleName": "read-package-up",
2256+
"docPath": "find-up",
2257+
"category": "preferred"
2258+
},
2259+
{
2260+
"type": "documented",
2261+
"moduleName": "read-pkg",
2262+
"docPath": "find-up",
2263+
"category": "preferred"
2264+
},
2265+
{
2266+
"type": "documented",
2267+
"moduleName": "read-pkg-up",
2268+
"docPath": "find-up",
2269+
"category": "preferred"
2270+
},
22172271
{
22182272
"type": "documented",
22192273
"moduleName": "readable-stream",

0 commit comments

Comments
 (0)