ape-repo/ape-watching

View on GitHub
example/example-watch-files.js

Summary

Maintainability
A
0 mins
Test Coverage
#!/usr/bin/env
'use strict'

const apeWatching = require('ape-watching')

const watchers = apeWatching.watchFiles([
  'src/javascripts/**/*.js',
  'assets/javascripts/**/*.js'
], (ev, filename) => {
  /* ... */
})

setTimeout(() => {
  watchers.forEach((watcher) => {
    watcher.close() // Stop watching
  })
}, 1000)