-
Notifications
You must be signed in to change notification settings - Fork 16
/
readdirp.node.txt
47 lines (40 loc) · 3.39 KB
/
readdirp.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
READDIRP
ALTERNATIVES ==> # - readdirp (preferred with Node):
# - most high-profile
# - streaming, filtering, maxDepth, symlinks
# - deno walk (preferred with Deno):
# - Deno core
# - streaming, filtering, maxDepth, symlinks
# - recursive-readdir:
# - filtering
# - fs-readdir-recursive:
# - filtering
# - readdir-enhanced:
# - less high-profile
# - streaming, filtering, maxDepth
VERSION ==> #3.6.0
READDIRP('PATH'[, OPTS]) #Calls FS.readdir() recursively.
->FILEINFO_STREAM #STREAM:
# - is closed when all files have been processed successfully or not
# - emits 'warn|error' ERROR
#OPTS:
# - fileFilter|directoryFilter VAL among:
# - FUNC(FILEINFO)->BOOL
# - 'GLOB'[_ARR] against filename (using micromatch)
# - can use '!GLOB'
# - type STR: whether to call FUNC() on:
# - 'files' (def)
# - 'directories'
# - 'files_directories'
# - 'all': anything, including character devices, etc.
# - depth NUM (def: none): max depth
# - lstat BOOL (def: false): use FS.lstat() instead of FS.stat()
#Uses OPTS.bigint true of FS.[l]stat() if Windows
FILEINFO.basename #Filename
FILEINFO.path #Path relative to OPTS.root
FILEINFO.fullPath #Absolute path
FILEINFO.stats #STAT or DIRENT according to OPTS.alwaysStat (def: false)
READDIRP.promise('PATH'[, OPTS])
->PROMISE_FILEINFO_ARR #Same but all at once