Skip to content

okdistribute/gaze-collect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

gaze-collect

Watches files for you and outputs all the changed files as they change.

NPM

var Collector = require('gaze-collect')
var watcher = Collector(['/path/to/dir', '/another/path/to/watched/dir'])

watcher.on('data', function (data) {
  // data is a list of the contents of each runtime as a JSON object
  // e.g. [
  // {
  //   "filepath": "/path/to/dir/another/file",
  //   "data": {etc..}
  //  }
  // ]
  //
})

watcher.close()

API

Collector(dirs, opts)

Returns a watcher

dirs: the directories to watch

opts

  • takes any options for the Gaze object
  • also includes: read: boolean. whether or not to read contents into the return object valid: function (filepath). returns true if filepath should be included. defauls to true parse: boolean. whether or not to parse file into json

watcher.close()

Closes the watcher -- stops watching the filesystem.

Events

There should be more, but right now it just emits one event -- that's when the kernel spec (kernel.json) has changed.

data

watcher.on('data', function (data) {
  // list of data
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages