glob-observable
Observable-based version of node-glob:
Match files using the patterns the shell uses, like stars and stuff.
const globObservable = ; ;
Installation
npm install glob-observable
API
const globObservable = ;
globObservable(pattern [, options])
pattern: string
(glob pattern)
options: Object
(glob
options with strict
and silent
default to true
)
Return: Observable
(zenparsing's implementation)
Match result
Type: Object
When the observable is subscribed, it starts glob search and send a result object to the observer on every match. Unlike node-glob's match
event, all results are deduplicated if nounique
option is disabled.
Each result object has the following properties:
cwd
Type: string
The current working directory where to search.
path
Type: string
The path of matched file or directory.
It'll be an absolute path if absolute
option is enabled, otherwise relative to cwd
. Also, it'll be resolved to a realpath if realpath
option is enabled.
stat
Type: fs.Stats
Information about the matched file or directory, for example mode and size. Only available if stat
option is enabled.
const globObservable = ; const observable = ;const subscription = observable; // You can abort matching at any time.subscription;
License
ISC License © 2017 Shinnosuke Watanabe