-
Notifications
You must be signed in to change notification settings - Fork 16
/
glob.node.txt
88 lines (69 loc) · 5.99 KB
/
glob.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
GLOB
ALTERNATIVES ==> # - glob (preferred with Node)
# - deno expand_glob (preferred with Deno)
VERSION ==> #7.1.2
#Gets files according to globbing (using minimatch, see its doc)
/=+===============================+=\
/ : : \
)==: CORE :==(
\ :_______________________________: /
\=+===============================+=/
Glob('GLOB'[, OPTS], #Gets list of files 'PATH'_ARR according to 'GLOB'
[FUNC(ERROR, 'PATH'_ARR)])->GLOB #OPTS:
new Glob('GLOB'[, OPTS][, FUNC]) # - all same as minimatch
# - cwd (def: process.cwd())
# - root (def: "/"): prepended to absolute path
# - nomount BOOL (def: false): if root != "/", root is used for searching the files, but not prepended to output
# - mark BOOL (def: false): appends "/" to directories
# - nodir BOOL (def: false): do not match directories, i.e. only files
# - ignore 'GLOB'[_ARR]: do not match those
# - nosort BOOL (def: false)
# - nounique BOOL: if false (def), removes duplicate files
# - follow BOOL (def: false): follow symlinks when resolving **
# - absolute BOOL (def: false): returns absolute 'PATH'
# - realpath BOOL (def: false): calls FS.realpath() on each 'PATH'
# - cache { PATH: VAL } (def: automatically created):
# - caches FS.readdir()
# - VAL can be false (does not exist), true (exists), 'PATH' (exists), ['DIR', 'CHILD_FILE',...] (exists)
# - statCache { PATH: FSSTAT } (def: automatically created): caching FS.lstat()
# - realpathCache { PATH: 'PATH2' } (def: automatically created): caching FS.realpath()
# - symlinks { PATH: 'PATH2' } (def: automatically created): caching symlinks follows when using OPTS.follow true
# - silent BOOL (def: false)
# - strict BOOL (def: false): stops on error
# - maxLength NUM: max 'GLOB' length
#OPTS can be GLOB2, to reuse GLOB2.options (e.g. re-use caches)
Glob.sync('GLOB'[, OPTS])
->'PATH'_ARR
new GlobSync('GLOB'[, OPTS], FUNC)#Same but sync
GLOB.options #OPTS
GLOB.* #OPTS.*
GLOB.found #BOOL. Whether some 'PATH' were found. Only with Glob.sync()
GLOB.minimatch #MINIMATCH
GLOB.on("match", FUNC('PATH')) #
GLOB.on("end", FUNC('PATH'_ARR)) #
GLOB.on("error", FUNC(ERROR)) #
GLOB.on("abort", FUNC()) #When GLOB.abort() is called. Sets GLOB.aborted to true
GLOB.pause|resume() #
GLOB.abort() #
Glob.hasMagic('GLOB'[,OPTS])->BOOL#Whether there is globbing
/=+===============================+=\
/ : : \
)==: STREAM :==(
\ :_______________________________: /
\=+===============================+=/
VERSION ==> ##Node module (6.1.0)
##Returns list of files matching globbing pattern as a ISTREAM, using node-glob.
GLOB-STREAM('GLOB'[_ARR][, OPTS])##Returns list of files as IOSTREAM in ObjectMode with OBJ:
->IOSTREAM ## - cwd: $PWD
## - base: PATH_STR before first globbing
## - path PATH_STR: file found
##OPTS:
## - any passed to GLOB (see its doc), except root
## - cwdbase BOOL (def: false): if true, sets OPTS.base = OPTS.cwd
## - uniqueBy 'PROP'|FUNC(FSSTAT)->BOOL (def: 'path'): how file duplicates are removed
## - allowEmpty BOOL: if false (def), emits error if not file matches
##If 'GLOB'_ARR:
## - executed in order
## - i.e. should pass "!..." at end