-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
41 lines (41 loc) · 3.78 KB
/
package.json
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
38
39
40
41
{
"name": "fs-watch-tree",
"version": "0.2.2",
"description": "Recursively watch directories for changes",
"homepage": "http://busterjs.org/doc/fs-watch-tree",
"author": {
"name": "Christian Johansen",
"email": "christian@cjohansen.no",
"url": "http://cjohansen.no"
},
"contributors": [
{
"name": "August Lilleaas",
"email": "august.lilleaas@gmail.com",
"url": "http://augustl.com"
},
{
"name": "Magnar Sveen",
"email": "magnars@gmail.com"
}
],
"main": "./lib/fs-watch-tree",
"repository": {
"type": "git",
"url": "https://github.com/busterjs/fs-watch-tree.git"
},
"scripts": {
"test": "./node_modules/buster/bin/buster-test"
},
"dependencies": {
"when": "https://github.com/cujojs/when/tarball/1.3.0"
},
"devDependencies": {
"buster": "*",
"rimraf": "*"
},
"readme": "# fs-watch-tree - Recursive fs.watch #\n\n[![Build status](https://secure.travis-ci.org/busterjs/fs-watch-tree.png?branch=master)](http://travis-ci.org/busterjs/fs-watch-tree/)\n\n**fs-watch-tree** is a small tool to watch directories for changes recursively.\nIt uses\n[fs-watch](http://nodejs.org/docs/latest/api/fs.html#fs_fs_watch_filename_options_listener)\nto watch for changes, thus should work on most platforms.\n\n## Synopsis ##\n\n var watchTree = require(\"fs-watch-tree\").watchTree;\n\n var watch = watchTree(\"/home/christian\", function (event) {\n // See description of event below\n });\n\n watch.end(); // Release watch\n\n watch = watchTree(\"/home/christian\", {\n exclude: [\"node_modules\", \"~\", \"#\", /^\\./]\n }, function (event) {\n // Respond to change\n });\n\n## `watchTree(dir, callback)` ##\n\nWatches directory `dir` recursively for changes.\n\nThe callback is called with an `event` object. The event is described below.\n\n## `watchTree(dir, options, callback)` ##\n\nWatch a directory recursively, with some specific options. Currently, you can\nonly specify a single option:\n\n { exclude: [] }\n\nThe `exclude` array specifies file patterns to exclude from watches. If a\npattern matches a directory, `watch-tree` will not recurse into it. If it\nmatches a file, changes to that file will not trigger an event.\n\nThe excludes can be either strings or regular expressions, but are always\ntreated as regular expressions. That means that\n\n { exclude: [\".git\", \"node_modules\"] }\n\nWill be treated the same way as:\n\n { exclude: [new RegExp(\".git\"), new RegExp(\"node_modules\")] }\n\nIf you only want to exclude specific files, be sure to provide full\npaths. `watch-tree` does not expand paths, it will resolve all paths relative to\nthe original directory. So this:\n\n watchFile(\".git\", function (event) { /* ... *) });\n\nWill watch (and consider excludes for) directories like `.git/branches`. And\nthis:\n\n watchFile(\"/home/christian/projects/watch-tree/.git\", function (event) {});\n\nWill watch (and consider excludes for) directories like\n`/home/christian/projects/watch-tree/.git`.\n\n## `event` ##\n\nThe event object has the following properties:\n\n### `name` ###\n\nThe full (relative) path to the file/directory that changed.\n\n### `isDirectory()` ###\n\nReturns true if the cause of the change was a directory. In some cases,\ne.g. when the directory was deleted, it's not possible to know if the\nsource was a directory. In that case, this method returns false.\n\n### `isMkdir()` ###\n\nReturns true if the cause of the event was a newly created directory.\n\n### `isDelete()` ###\n\nReturns true if the cause of the event was a deleted file/directory.\n\n### `isModify()` ###\n\nReturns true if the cause of the event was a modified file/directory.\n",
"readmeFilename": "README.md",
"_id": "fs-watch-tree@0.2.2",
"_from": "fs-watch-tree@0.2.2"
}