-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathgaze.node.txt
37 lines (30 loc) · 1.71 KB
/
gaze.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
┏━━━━━━━━━━┓
┃ GAZE ┃
┗━━━━━━━━━━┛
ALTERNATIVES ==> #See chokidar
VERSION ==> #Node module (0.6.4)
GAZE(GEXP_STR[_ARR][, OBJ], #Uses MINIMATCH to get a list of files, then fires FUNC()
FUNC(ERROR, WATCHER)) #OBJ has members:
# - mode STR: among "watch" (interrupts), "poll" (polling) or "auto" (déf)
# - interval UINT: when polling (def: 100)
# - debounceDelay UINT: delay between two same events on same file (def: 500)
# - cwd STR: like for NODE-GLOB
# - any MINIMATCH option
WATCHER.watched
(FUNC2(ERROR, PATH_ARR)) #Gets all watched files as PATH_ARR
WATCHER.relative([DIR[, BOOL]],
FUNC2(ERROR, PATH_ARR)) #Same but relative to DIR (déf: $PWD). If BOOL true, returns Windows \ path as /
WATCHER.add(GEXP_STR[_ARR]
[, FUNC()]) #Changes watched files list
WATCHER.close() #Stops watching
WATCHER.on( "end", FUNC() ) #When stop watching
WATCHER.on( "changed|added|
deleted", FUNC(PATH) ) #Events on file that didn't exist while GAZE() was firing only works when using globbing
WATCHER.on( "renamed",
FUNC(NEWPATH, OLDPATH) ) #Does not seem to work
WATCHER.on( "all",
FUNC(EVENT_STR, PATH) ) #Not for "renamed"
WATCHER.on( "error",FUNC(ERROR))#
WATCHER.on( "nomatch", FUNC() ) #When no files match
WATCHER.this.emit(EVENT_STR
[, ...]) #Artificially emits events