2018.6.16-0 • Published 6 years ago

@amory/src-fs-watch v2018.6.16-0

Weekly downloads
-
License
(Apache-2.0 OR MI...
Repository
github
Last release
6 years ago
  • @amory/src-fs-watch

** Overview

The intention of this package is to provide a single process and interface for all desired file watching activities. Only file changes and deletions are reported. Saving files without changing their content are intentionally not reported. Consumers receive all reported file events starting with the beginning of the file watching process. Events can easily be filtered using any method supported by RxJs =.pipe=, e.g. =filter=, =map=, =reduce=, etc.

** Install

#+begin_src sh npm install --save @amory/src-fs-watch #+end_src

** Example

#+begin_src js const srcFsWatch = require ("@amory/src-fs-watch") const { join } = require ("path").posix const { filter } = require ("rxjs/operators")

// Any valid chokidar options (plus src) can be passed here: const watcher = srcFsWatch ({ "src": join (process.cwd (), "src") })

watcher .pipe (filter (({ src }) => /.js(on)?$/.test (src))) .subscribe ({ "next": ({ evt, src }) => console.log (evt, src) }) #+end_src

** Credits

Inspired by original code and concepts from:

2018.6.16-0

6 years ago

2018.6.12-5

6 years ago

2018.6.12-4

6 years ago

2018.6.12-3

6 years ago

2018.6.12-2

6 years ago

2018.6.12-1

6 years ago

2018.6.12-0

6 years ago

2018.6.7-2

6 years ago

2018.6.7-1

6 years ago

2018.6.7-0

6 years ago

2018.6.6-10

6 years ago

2018.6.6-9

6 years ago

2018.6.6-8

6 years ago

2018.6.6-7

6 years ago

2018.6.6-6

6 years ago

2018.6.6-5

6 years ago

2018.6.6-4

6 years ago

2018.6.6-3

6 years ago

2018.6.6-2

6 years ago

2018.6.6-1

6 years ago